<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html"/>
	<xsl:variable name="Version">Version:VTP3.25N</xsl:variable>
	<xsl:variable name="ShowVoids" select="false()"/>
	<xsl:variable name="ShowZeroItems" select="true()"/>
	
	<xsl:variable name="PrintFormat">Narrow</xsl:variable>

	<xsl:decimal-format name="VND" decimal-separator="." grouping-separator=","/>
	<xsl:decimal-format name="GBP" decimal-separator="." grouping-separator=","/>

	<xsl:template name="format-currency">
		<xsl:param name="value"/>

		<xsl:if test="//POSTRANSACTION/@NM_CNY_ICD='GBP'">
			<xsl:value-of select="format-number($value,'####0.00',//POSTRANSACTION/@NM_CNY_ICD)"/>
		</xsl:if>

		<xsl:if test="//POSTRANSACTION/@NM_CNY_ICD='VND'">
			<xsl:value-of select="format-number($value,'#,###,###,#00',//POSTRANSACTION/@NM_CNY_ICD)"/>
		</xsl:if>
	</xsl:template>

    <xsl:template name="NewLine">
  		<xsl:param name="value"/>
           <xsl:if test="$value&gt;0">
              <L>&#x20;</L>
              <xsl:call-template name="NewLine">
                <xsl:with-param name="value">
                     <xsl:value-of select="$value - 1" />
                 </xsl:with-param>
             </xsl:call-template>
        </xsl:if>

    </xsl:template>



	<xsl:template name="RedInvoice">
	  <xsl:if test="//POSTRANSACTION/@NM_FORMAT=0">
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>

			<TABLE COLS="1,3,4,12,14,19,21,23,25,30">
				<TR>
					<TD></TD>
					<TD>
						<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,5,2)"/>
					</TD>
					<TD></TD>
					<TD>
						<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,3,2)"/>
					</TD>
					<TD></TD>
					<TD>20</TD>
					<TD>
						<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,1,2)"/>
					</TD>
					<TD></TD>
					<TD>
						<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,7,2)"/>:<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,9,2)"/>
					</TD>
				</TR>
			</TABLE>				
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>




			<TABLE COLS="1,17,18,20,33">
				<xsl:for-each select="//POSTRANSACTION/SALESTAX">

					<xsl:if test="TRANSACTIONDETAIL/@MO!=0">
						<TR>
							<TD>Food/Bev</TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
								<xsl:variable name="V" select="number(//POSTRANSACTION/@MO_TTL)-sum(//POSTRANSACTION/SALEITEM[@FL_SVC_CHRG=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALEITEM[@FL_GRT=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO)"/>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="$V"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>

						<xsl:if test="sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_SVC_CHRG=-1)]/TRANSACTIONDETAIL/@MO)!=0">
							<TR>
								<TD>Holiday Surcharge</TD>
								<TD></TD>
								<TD></TD>
								<TD ALIGN="RIGHT">
									<xsl:call-template name="format-currency">
										<xsl:with-param name="value">
											<xsl:value-of select="0.8 * sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_SVC_CHRG=-1)]/TRANSACTIONDETAIL/@MO)"/>
										</xsl:with-param>
									</xsl:call-template>
								</TD>
							</TR>
							<TR>
								<TD>Service Charge</TD>
								<TD></TD>
								<TD></TD>
								<TD ALIGN="RIGHT">
									<xsl:call-template name="format-currency">
										<xsl:with-param name="value">
											<xsl:value-of select="0.2 * sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_SVC_CHRG=-1)]/TRANSACTIONDETAIL/@MO)"/>
										</xsl:with-param>
									</xsl:call-template>
								</TD>
							</TR>
						</xsl:if>
					</xsl:if>
				</xsl:for-each>

				<xsl:for-each select="//POSTRANSACTION/SALESTAX">
					<xsl:if test="TRANSACTIONDETAIL/@MO!=0">
						<TR>
							<TD>SubTotal VAT</TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@MO_TX"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>

						<TR>
							<TD>
								<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/>
							</TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
					</xsl:if>
				</xsl:for-each>
				<TR>
					<TD>
						<B>Total VND</B>
					</TD>
					<TD ALIGN="RIGHT"></TD>
					<TD ALIGN="RIGHT"></TD>
					<TD ALIGN="RIGHT">
						<B>
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="//POSTRANSACTION/@MO_TTL"/>
								</xsl:with-param>
							</xsl:call-template>
						</B>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>

				<TR>
					<TD>Exchange Rate:</TD>
				</TR>
				<TR>
					<TD>&#x20;&#x20;&#x20;1 USD = <xsl:value-of select="//POSTRANSACTION/@RATE_USD"/> VND</TD>
				</TR>
				<TR>
					<TD>Total USD</TD>
					<TD></TD>
					<TD></TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="format-number(//POSTRANSACTION/@USD_MO_TTL,'##,##0.00')"/>
					</TD>
				</TR>
				<TR>
					<TD>&#x20;&#x20;&#x20;1 EUR = <xsl:value-of select="//POSTRANSACTION/@RATE_EURO"/> VND</TD>
				</TR>
				<TR>
					<TD>Total EUR</TD>
					<TD></TD>
					<TD></TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="format-number(//POSTRANSACTION/@EUR_MO_TTL,'##,##0.00')"/>
					</TD>
				</TR>

				<TR>
					<TD></TD>
				</TR>

				<xsl:for-each select="//POSTRANSACTION/TENDER[TRANSACTIONDETAIL/@FL_VD=0]">
					<TR>
						<TD>
							<xsl:value-of select="TRANSACTIONDETAIL/@DSC" />
						</TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
								</xsl:with-param>
							</xsl:call-template>
						</TD>
					</TR>
				</xsl:for-each>

				<xsl:for-each select="//POSTRANSACTION/PMSCHARGE/TENDER[TRANSACTIONDETAIL/@FL_VD=0]">
					<TR>
						<TD>
							<xsl:value-of select="TRANSACTIONDETAIL/@DSC" />
						</TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
								</xsl:with-param>
							</xsl:call-template>
						</TD>
					</TR>
				</xsl:for-each>
			</TABLE>



			<xsl:call-template name="NewLine">
				<xsl:with-param name="value">
					<xsl:value-of select="18-
                                    count(//POSTRANSACTION/TENDER[TRANSACTIONDETAIL/@FL_VD=0])
                                    -count(//POSTRANSACTION/PMSCHARGE/TENDER[TRANSACTIONDETAIL/@FL_VD=0])
                                    -count(//POSTRANSACTION/SALEITEM[@FL_SVC_CHRG=-1])
                                    -count(//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL[@MO!=0])
                "/>
				</xsl:with-param>
			</xsl:call-template>

			<L>#(POS):<xsl:value-of select="//POSTRANSACTION/@NM_REF"/></L>
			<L>Transaction(POS): <xsl:value-of select="//POSTRANSACTION/@AI_TRN"/></L>
			<L>&#x20;</L>

			<TABLE COLS="1,17,33">
				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@NM_CT"/>
					</TD>
				</TR>
				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@NM_ADDR"/>
					</TD>
				</TR>


				<TR>
					<TD>&#x20;</TD>
					<TD></TD>
				</TR>


				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/PMSCHARGE[TENDER/TRANSACTIONDETAIL/@FL_VD=0]/@room"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="//POSTRANSACTION/@NM_VAT"/>
					</TD>
				</TR>

				<TR>
					<TD>&#x20;</TD>
					<TD></TD>
				</TR>
				<TR>
					<TD>&#x20;</TD>
					<TD></TD>
				</TR>


				<TR>
					<TD></TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="//POSTRANSACTION/@NM_OPR"/>
					</TD>
				</TR>


			</TABLE>
		</xsl:if>


		<!-- RESTAURANT FORMAT START -->
		<xsl:if test="//POSTRANSACTION/@NM_FORMAT=1">
			<L></L>
			<L></L>
			<L></L>
			<L>&#x20;</L>

			<L>
				<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,5,2)"/>&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,3,2)"/>&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;20<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,1,2)"/>
			</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>


			<xsl:variable name="VSubTotal" select="number(//POSTRANSACTION/@MO_TTL)-sum(//POSTRANSACTION/SALEITEM[@FL_SVC_CHRG=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALEITEM[@FL_GRT=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO)"/>
			<TABLE COLS="1,19,29">
				<TR>
					<TD>&#x20;&#x20;&#x20;Dich Vu An Uong</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$VSubTotal"/>
							</xsl:with-param>
						</xsl:call-template>

					</TD>
				</TR>
				<TR>
					<TD>
					</TD>
				</TR>
				<TR>
					<TD></TD>
					<TD ALIGN="RIGHT">
					</TD>
				</TR>
				<TR>
					<TD>
					</TD>
				</TR>
				<TR>
					<TD></TD>
					<TD ALIGN="RIGHT">
					</TD>
				</TR>
			</TABLE>

			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<TABLE COLS="1,10,24">
				<TR>
					<TD>
						<!--
						<xsl:value-of select="//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@DSC"/>
						-->
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/SALESTAX/@MO_TX"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>

				<TR>
					<TD>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/@MO_TTL"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</TABLE>

			<L></L>
			<TABLE COLS="1,32">
				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@MO_TTL_WORD"/>
					</TD>
				</TR>
			</TABLE>

			<L></L>
			<L></L>
			<L>
				<xsl:value-of select="//POSTRANSACTION/@NM_CT"/>
			</L>
			<L>
				<xsl:value-of select="//POSTRANSACTION/@NM_ADDR"/>
			</L>
			<L></L>
			<L></L>
			<TABLE COLS="10,17">
				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/TENDER/TRANSACTIONDETAIL/@DSC"/>
					</TD>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@NM_VAT"/>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@END_NM_OPR"/>
					</TD>
				</TR>
			</TABLE>

		</xsl:if>
		<!-- RESTAURANT FORMAT END -->


		<!-- DISCO FORMAT START -->
		<xsl:if test="//POSTRANSACTION/@NM_FORMAT=2">
			<L></L>
			<L></L>
			<L></L>
			<L>&#x20;</L>

			<L>
				<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,5,2)"/>&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,3,2)"/>&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;20<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,1,2)"/>
			</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>


			<xsl:variable name="VSubTotal" select="number(//POSTRANSACTION/@MO_TTL)-sum(//POSTRANSACTION/SALEITEM[@FL_SVC_CHRG=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALEITEM[@FL_GRT=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO)"/>
			<TABLE COLS="1,19,29">
				<TR>
					<TD>&#x20;&#x20;&#x20;Dich Vu Disco</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$VSubTotal * 0.7"/>
							</xsl:with-param>
						</xsl:call-template>

					</TD>
				</TR>
				<TR>
					<TD>
					</TD>
				</TR>
				<TR>
					<TD>&#x20;&#x20;&#x20;Thue TTDB</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$VSubTotal * 0.3"/>
							</xsl:with-param>
						</xsl:call-template>

					</TD>
				</TR>
				<TR>
					<TD>
					</TD>
				</TR>
				<TR>
					<TD>&#x20;&#x20;&#x20;Phi Phuc Vu</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_SVC_CHRG=-1)]/TRANSACTIONDETAIL/@MO)"/>
							</xsl:with-param>
						</xsl:call-template>

					</TD>
				</TR>
			</TABLE>

			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<TABLE COLS="1,10,24">
				<TR>
					<TD>
						<!--
						<xsl:value-of select="//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@DSC"/>
						-->
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/SALESTAX/@MO_TX"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>

				<TR>
					<TD>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/@MO_TTL"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</TABLE>

			<L></L>
			<TABLE COLS="1,32">
				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@MO_TTL_WORD"/>
					</TD>
				</TR>
			</TABLE>

			<L></L>
			<L></L>
			<L>
				<xsl:value-of select="//POSTRANSACTION/@NM_CT"/>
			</L>
			<L>
				<xsl:value-of select="//POSTRANSACTION/@NM_ADDR"/>
			</L>
			<L></L>
			<L></L>
			<TABLE COLS="10,17">
				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/TENDER/TRANSACTIONDETAIL/@DSC"/>
					</TD>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@NM_VAT"/>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@END_NM_OPR"/>
					</TD>
				</TR>
			</TABLE>

		</xsl:if>
		<!-- DISCO FORMAT END -->


		<!-- HEALTHCLUB FORMAT START -->
		<xsl:if test="//POSTRANSACTION/@NM_FORMAT=3">
			<L></L>
			<L></L>
			<L></L>
			<L>&#x20;</L>

			<L>
				<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,5,2)"/>&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,3,2)"/>&#x20;&#x20;&#x20;&#x20;&#x20;&#x20;20<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,1,2)"/>
			</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>


			<xsl:variable name="VSubTotal" select="number(//POSTRANSACTION/@MO_TTL)-sum(//POSTRANSACTION/SALEITEM[@FL_SVC_CHRG=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALEITEM[@FL_GRT=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO)"/>
			<TABLE COLS="1,19,29">
				<TR>
					<TD>&#x20;&#x20;&#x20;Dich Vu Massage</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$VSubTotal * 0.7"/>
							</xsl:with-param>
						</xsl:call-template>

					</TD>
				</TR>
				<TR>
					<TD>
					</TD>
				</TR>
				<TR>
					<TD>&#x20;&#x20;&#x20;Thue TTDB</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$VSubTotal * 0.3"/>
							</xsl:with-param>
						</xsl:call-template>

					</TD>
				</TR>
				<TR>
					<TD>
					</TD>
				</TR>
				<TR>
					<TD>&#x20;&#x20;&#x20;PHI PHUC VU</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_SVC_CHRG=-1)]/TRANSACTIONDETAIL/@MO)"/>
							</xsl:with-param>
						</xsl:call-template>

					</TD>
				</TR>
			</TABLE>

			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<L>&#x20;</L>
			<TABLE COLS="1,10,24">
				<TR>
					<TD>
						<!--
						<xsl:value-of select="//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@DSC"/>
						-->
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/SALESTAX/@MO_TX"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>

				<TR>
					<TD>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="//POSTRANSACTION/@MO_TTL"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</TABLE>

			<L></L>
			<TABLE COLS="1,32">
				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@MO_TTL_WORD"/>
					</TD>
				</TR>
			</TABLE>

			<L></L>
			<L></L>
			<L>
				<xsl:value-of select="//POSTRANSACTION/@NM_CT"/>
			</L>
			<L>
				<xsl:value-of select="//POSTRANSACTION/@NM_ADDR"/>
			</L>
			<L></L>
			<L></L>
			<TABLE COLS="10,17">
				<TR>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/TENDER/TRANSACTIONDETAIL/@DSC"/>
					</TD>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@NM_VAT"/>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD></TD>
					<TD>
						<xsl:value-of select="//POSTRANSACTION/@END_NM_OPR"/>
					</TD>
				</TR>
			</TABLE>

		</xsl:if>
		<!-- HEALTHCLUB FORMAT END -->

	</xsl:template>


	<xsl:template match="/">
		<PrintSlip>
			<xsl:choose>
				<xsl:when test="(//POSTRANSACTION/@PRINT_OPT=60)">
					<xsl:call-template name="ITEMVOUCHERS">
						<xsl:with-param name="ITEMS" select="//POSTRANSACTION/SALEITEM[@SCM_VCHR&gt;0]"/>
					</xsl:call-template>
				</xsl:when>

				<xsl:when test="(//POSTRANSACTION/@PRINT_OPT=50)">
					<xsl:apply-templates select="//POSTRANSACTION/CREDITDEBIT"/>
				</xsl:when>

                <xsl:when test="(//POSTRANSACTION/@PRINT_OPT=70)">
					<xsl:call-template name="RedInvoice">
					</xsl:call-template>
				</xsl:when>

				
				
				<xsl:otherwise>
					<xsl:apply-templates select="POSTRANSACTION"/>
				</xsl:otherwise>




			</xsl:choose>
		</PrintSlip>
	</xsl:template>



	<xsl:template name="CUT">
		<L></L>
		<L></L>
		<L></L>
		<L></L>
		<L></L>
		<L></L>
		<L></L>
		<CUT></CUT>
	</xsl:template>
	<xsl:template name="FOOTER">
		<L>Date:<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,5,2)"/>/<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,3,2)"/>/<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,1,2)"/>
			<SP/>- <xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,7,2)"/>:<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,9,2)"/>
			</L>
		<L>Server:<xsl:value-of select="//POSTRANSACTION/@NM_OPR"/></L>
		<xsl:if test="(//POSTRANSACTION/@TY_TRN=103)">
			<L>Cashier:<xsl:value-of select="//POSTRANSACTION/@END_NM_OPR"/> Terminal:<xsl:value-of select="//POSTRANSACTION/@END_ID_WS"/></L>
		</xsl:if>
		<L><xsl:value-of select="$Version"/></L>
	</xsl:template>

	<xsl:template name="ITEMVOUCHER">
		<xsl:param name="Q"/>

		<xsl:if test="TRANSACTIONDETAIL/@FL_VD_LN_ITM=0">
			<xsl:if test="@SCM_VCHR=2">
				<L>[LOGO <xsl:value-of select="TRANSACTIONDETAIL/@CD_IMAGE"/> ]</L>
				<xsl:variable name="P" select="@MO_NET div @QU"/>
				<L>
					<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/>
				</L>
				<L>
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$P"/>
						</xsl:with-param>
					</xsl:call-template>
				</L>

				<L>
					<xsl:value-of select="//POSTRANSACTION/@AI_TRN"/>
				</L>
				<L>**************************************</L>
				<L></L>
			</xsl:if>

			<xsl:if test="@SCM_VCHR=1">
				<C>
					<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP1"/>
				</C>
				<C>
					<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP2"/>
				</C>
				<C>
					<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP3"/>
				</C>
				<!---<C>
					<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP4"/>
				</C>
				<C>
					<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP5"/>
				</C>
				<L></L>
				<L>*************************************</L>-->


				<xsl:variable name="P" select="@MO_NET div @QU"/>

				<L>Item : <xsl:value-of select="TRANSACTIONDETAIL/@DSC"/></L>
				<L>Price: <xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$P"/>
						</xsl:with-param></xsl:call-template></L>
				<L>**************************************</L>
				<L></L>
			</xsl:if>

			<xsl:call-template name="FOOTER"/>
			<xsl:call-template name="CUT"/>

			<xsl:if test="$Q&gt;1">
				<xsl:variable name="QLESS1" select="number($Q) - 1"/>
				<xsl:call-template name="ITEMVOUCHER">
					<xsl:with-param name="Q" select="number($Q)-1"/>
				</xsl:call-template>
			</xsl:if>
		</xsl:if>
	</xsl:template>



	<xsl:template name="ITEMVOUCHERS">
		<xsl:param name="ITEMS"/>
		<xsl:for-each select="$ITEMS">
			<xsl:call-template name="ITEMVOUCHER">
				<xsl:with-param name="Q" select="@QU"/>
			</xsl:call-template>
		</xsl:for-each>
	</xsl:template>



	<xsl:template match="PDRDETAIL">
		<xsl:if test="@TY_RU_PRDV=5">
			<L>[LOGO <xsl:value-of select="@NM_RU_PRDV"/>]</L>

			<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP1"/>
			</C>
			<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP2"/>
			</C>
			<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP3"/>
			</C>
			<!--<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP4"/>
			</C>
			<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP5"/>
			</C>-->
			<L></L>
			<C>
				<B>COUPON</B>
			</C>
			<C><B><xsl:value-of select="//POSTRANSACTION/@NM_TY_TRN"/></B></C>
            <C>#<B><xsl:value-of select="//POSTRANSACTION/@AI_TRN"/>1</B>
                <xsl:if test="@ID_TBL">
			<C>Table: <xsl:value-of select="@NM_TBL"/></C>
		</xsl:if>
	    </C>	

			<L></L>
			<TABLE COLS="1,22">
				<TR>
					<TD>CODE:</TD>
					<TD>
						<xsl:value-of select="@ID_RU_PRDV"/>
					</TD>
				</TR>
				<TR>
					<TD>DESCRIPTION:</TD>
					<TD>
						<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/>
					</TD>
				</TR>
				<TR>
					<TD>SERIAL:</TD>
					<TD>
						<xsl:value-of select="@SR_NMB"/>
					</TD>
				</TR>
				<TR>
					<TD>VALID UNTIL:</TD>
					<TD>
						<xsl:value-of select="@DC_EP_STR"/>
					</TD>
				</TR>
			</TABLE>
			<L></L>
			<C>
				<xsl:value-of select="@MSG"/>
			</C>
			<L></L>
			<L>[BARCODE <xsl:value-of select="@SR_NMB"/>]</L>
			<L></L>
			<xsl:call-template name="FOOTER"/>
			<xsl:call-template name="CUT"/>
		</xsl:if>
	</xsl:template>

	<xsl:template name="multiline">
		<xsl:param name="line"/>
		<xsl:if test="string-length($line)&gt;0">
			<L>
				<xsl:value-of select="substring-before($line,'&#xD;')"/>
			</L>
			<xsl:call-template name="multiline">
				<xsl:with-param name="line" select="substring-after($line,'&#xD;')"/>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>



	<xsl:template name="CCNUMBER">
		<xsl:param name="CD_CARD"/>
		<xsl:param name="DE_TRACK2"/>
		<xsl:choose>
			<xsl:when test="string-length($CD_CARD)&gt;0">
				<xsl:variable name="CCC" select="@CD_CARD"/>
				<xsl:variable name="LLL" select="string-length($CCC)-3"/>
				<xsl:value-of select="substring($CCC,1,2)"/>***<xsl:value-of select="substring($CCC,$LLL,4)"/></xsl:when>
			<xsl:when test="string-length($DE_TRACK2)&gt;0">
				<xsl:variable name="CCC" select="@DE_TRACK2"/>
				<xsl:variable name="LLL" select="string-length($CCC)-3"/>
				<xsl:value-of select="substring($CCC,1,2)"/>***<xsl:value-of select="substring($CCC,$LLL,4)"/></xsl:when>
			<xsl:otherwise>-</xsl:otherwise>
		</xsl:choose>
	</xsl:template>


	<xsl:template match="READ-REPORT">
		<xsl:param name="XORZ"/>


		<xsl:if test="(@READ_TYPE='XOperator')">
			<C>For Operator :<xsl:value-of select="@XREAD_NM_OPR"/></C>
			<C>Till #<xsl:value-of select="@ID_TL"/></C>
			<L></L>
		</xsl:if>

		<xsl:if test="(@READ_TYPE='ZOperator')">
			<C>For Operator :<xsl:value-of select="@XREAD_NM_OPR"/></C>
			<C>Till #<xsl:value-of select="@ID_TL"/></C>
			<L></L>
		</xsl:if>


		<xsl:variable name="TotalDepartmentSales" select="LST_DPT_POS/@MO"/>
		<xsl:variable name="CorrectionSales" select="LST_DPT_POS/@MO"/>
		<xsl:variable name="TransactionCount" select="sum(//PERF_OPR/OPR/@QU_TRN)"/>
		<xsl:variable name="PartySizeCount" select="sum(//PERF_OPR/OPR/@QU_PARTY)"/>
		<xsl:variable name="CorrectionCount" select="sum(//PERF_OPR/OPR/@QU_ERRORCORRECT)"/>
		<xsl:variable name="CorrectionAmount" select="sum(//PERF_OPR/OPR/@MO_ERRORCORRECT)"/>
		<xsl:variable name="VoidCount" select="sum(//PERF_OPR/OPR/@QU_CANCEL)"/>
		<xsl:variable name="VoidAmount" select="sum(//PERF_OPR/OPR/@MO_CANCEL)"/>

		<TABLE COLS="1,19">
			<TR>
				<TD>OPEN TRANSACTIONS:</TD>
				<TD>
					<xsl:value-of select="@QU_ACT_TRN"/>
				</TD>
			</TR>
			<TR></TR>
			<TR>
				<TD>REVENUE CENTER:</TD>
				<TD>
					<xsl:value-of select="@ID_RVNU"/>
				</TD>
			</TR>
			<TR>
				<TD>DATE:</TD>
				<TD>
					<xsl:value-of select="@TS_TRN_BGN_DATE"/>
				</TD>
			</TR>
			<TR>
				<TD>TIME:</TD>
				<TD>
					<xsl:value-of select="@TS_TRN_BGN_TIME"/>
				</TD>
			</TR>
			<TR>
				<TD>TERMINAL:</TD>
				<TD>
					<xsl:value-of select="@NM_WS"/>(<xsl:value-of select="@ID_WS"/>)</TD>
			</TR>
			<!--
         <TR>
             <TD>SHIFT:</TD>
             <TD><xsl:value-of select="GENERAL/@NM_SHFT"/> (<xsl:value-of select="GENERAL/@ID_SHFT"/>)</TD>
         </TR>
-->
			<TR>
				<TD>Z NUMBER:</TD>
				<TD>
					<xsl:value-of select="@ID_Z"/>
				</TD>
			</TR>
			<TR>
				<TD>TRANSACTIONS:</TD>
				<TD>
					<xsl:value-of select="@QU_TRN"/>
				</TD>
			</TR>
			<TR>
				<TD>TERMINALS:</TD>
				<TD>
					<xsl:value-of select="@LST_WS"/>
				</TD>
			</TR>
		</TABLE>
		<L></L>
		<L></L>
		<L>
			<B>BALANCE</B>
		</L>
		<L>--------------------------------</L>
		<!--
     <L>12345678901234567890123456789012345678</L>
-->
		<TABLE COLS="1,20,33">
			<xsl:for-each select="RPSTY/TY_TRN">
				<TR>
					<TD>
						<xsl:value-of select="@DSC"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
						<xsl:if test="@MO&lt;0">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="-@MO"/>
								</xsl:with-param>
							</xsl:call-template>
						</xsl:if>
						<xsl:if test="not (@MO&lt;0)">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="@MO"/>
								</xsl:with-param>
							</xsl:call-template>
						</xsl:if>
					</TD>
				</TR>
			</xsl:for-each>
		</TABLE>
		<L>--------------------------------</L>
		<TABLE COLS="1,20,33">
			<TR>
				<TD>VARIANCE <xsl:if test="RPSTY/@MO&lt;0">(OVER)</xsl:if>
					<xsl:if test="not (RPSTY/@MO&lt;0)">(SHORT)</xsl:if>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:if test="RPSTY/@MO&lt;0">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="-RPSTY/@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</xsl:if>
					<xsl:if test="not (RPSTY/@MO&lt;0)">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="RPSTY/@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</xsl:if>
				</TD>
			</TR>
		</TABLE>
		<L></L>
		<L></L>
		<L>
			<B>PERFORMANCE</B>
		</L>
		<L>--------------------------------</L>
		<!--
     <L>12345678901234567890123456789012345678</L>
-->
		<TABLE COLS="1,20,33">
			<TR>
				<TD>TRANSACTIONS</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$TransactionCount"/>
				</TD>
			</TR>
			<TR>
				<TD>COVERS</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$PartySizeCount"/>
				</TD>
			</TR>
			<TR>
				<TD>ASPH</TD>
				<TD ALIGN="RIGHT">
					<xsl:if test="not ($PartySizeCount=0)">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$TotalDepartmentSales div $PartySizeCount"/>
							</xsl:with-param>
						</xsl:call-template>
					</xsl:if>
				</TD>
			</TR>
			<TR>
				<TD>SALES</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="LST_DPT_POS/@MO"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<L>--------------------------------</L>
		<L></L>
		<L></L>
		<L>
			<B>CORRECTIONS</B>
		</L>
		<L>--------------------------------</L>
		<!--
     <L>12345678901234567890123456789012345678</L>
-->
		<TABLE COLS="1,20,24,33">
			<TR>
				<TD>NO SALES</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="sum(//PERF_OPR/OPR/@QU_NOSALE)"/>
				</TD>
			</TR>
			<TR>
				<TD>ERROR CORRECTS</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$CorrectionCount"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$CorrectionAmount"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD>% ERROR CORRECTS</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:if test="not (($CorrectionSales+$CorrectionAmount+$VoidAmount)=0)">
						<xsl:value-of select="format-number($CorrectionAmount div ($CorrectionSales+$CorrectionAmount+$VoidAmount) ,'0%')"/>
					</xsl:if>
				</TD>
			</TR>
			<TR>
				<TD>VOIDS</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$VoidCount"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$VoidAmount"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD>% VOIDS</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:if test="not (($CorrectionSales+$CorrectionAmount+$VoidAmount)=0)">
						<xsl:value-of select="format-number($VoidAmount div ($CorrectionSales+$CorrectionAmount+$VoidAmount), '0%')"/>
					</xsl:if>
				</TD>
			</TR>
			<TR>
				<TD>REFUNDS</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="sum(//PERF_OPR/OPR/@QU_REFUND)"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="sum(//PERF_OPR/OPR/@MO_REFUND)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD>COVERS REMOVED</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="sum(//PERF_OPR/OPR/@QU_COVERSUPRESS)"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="sum(//PERF_OPR/OPR/@MO_COVERSUPRESS)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<L>--------------------------------</L>
		<L></L>
		<L></L>
		<L>
			<B>TOTAL DEPARTMENT SALES</B>
		</L>
		<L>--------------------------------</L>
		<!--
     <L>12345678901234567890123456789012345678</L>
-->
		<TABLE COLS="1,6,22,33">
			<xsl:for-each select="LST_DPT_POS/DPT_POS">
				<TR>
					<TD>(<xsl:value-of select="@KEY"/>)</TD>
					<TD>
						<xsl:value-of select="@DSC"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:for-each>
		</TABLE>
		<L>--------------------------------</L>
		<TABLE COLS="1,6,22,33">
			<TR>
				<TD>TOTAL</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="LST_DPT_POS/@MO"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<L></L>
		<L></L>
		<L>
			<B>HOURLY SALES</B>
		</L>
		<L>--------------------------------</L>
		<!--
     <L>12345678901234567890123456789012345678</L>
-->
		<TABLE COLS="1,7,12,20,33">
			<xsl:for-each select="LST_HR/HR">
				<TR>
					<TD>
						<xsl:value-of select="@DSC"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@CNT"/>
					</TD>

					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalDepartmentSales=0)">
							<xsl:value-of select="format-number(@MO div $TotalDepartmentSales * 100,'##0')"/>%</xsl:if>
					</TD>

					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:for-each>
		</TABLE>
		<L>--------------------------------</L>
		<TABLE COLS="1,7,12,20,33">
			<TR>
				<TD>TOTAL</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="LST_HR/@CNT"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="format-number($TotalDepartmentSales div $TotalDepartmentSales * 100,'##0')"/>%</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="LST_HR/@MO"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<L></L>
		<L></L>
		<L>
			<B>PAYMENT LIFTS</B>
		</L>
		<L>--------------------------------</L>
		<!--
     <L>12345678901234567890123456789012345678</L>
     MO_RT,
     MO_CURR
-->
		<TABLE COLS="1,7,12,19,27,33">
			<xsl:for-each select="BAL_RPSTY/DETAILED_TRANS[@TY_TRN=121]">
				<TR>
					<TD>
						<xsl:value-of select="@DE_TND"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@TS_TRN_BGN"/>
					</TD>
					<xsl:if test="@MO_RT=1">
						<TD></TD>
						<TD></TD>
					</xsl:if>
					<xsl:if test="not(@MO_RT=1)">
						<TD ALIGN="RIGHT">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="-@MO_CURR"/>
								</xsl:with-param>
							</xsl:call-template>
						</TD>
						<TD ALIGN="RIGHT">@<xsl:value-of select="format-number(@MO_RT,'#0.0000')"/></TD>
					</xsl:if>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="-@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:for-each>
		</TABLE>



		<L>--------------------------------</L>
		<TABLE COLS="1,20,30,33">
			<TR>
				<TD>TOTAL</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="-sum(BAL_RPSTY/DETAILED_TRANS[@TY_TRN=121]/@MO)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<!--
     <L></L>
     <L></L>
     <L>TOTAL PAYMENT METHODS (SALES)</L>


     <TABLE COLS="1,9,12,21,30,38">

     <xsl:variable name="unique-tender"
        select="SALE_LST_TND
        /TND[not(@KEY=preceding-sibling::TND/@KEY)]/@KEY"
     />

     <xsl:for-each select="$unique-tender">
     <TR>
         <xsl:variable name="des" select="//TND[@KEY=current()]/@DSC"/>
         <TD><xsl:value-of select="substring($des,1,8)"/></TD>
         <TD ALIGN="RIGHT"><xsl:value-of select="sum(//SALE_LST_TND/TND[@KEY=current()]/@CNT)"/></TD>
         <TD ALIGN="RIGHT">
            <xsl:value-of select="format-number(sum(//SALE_LST_TND/TND[@KEY=current()]/@MO2),'0.00')"/>
         </TD>
         <TD ALIGN="RIGHT">
            <xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
            <xsl:value-of select="format-number(sum(//SALE_LST_TND/TND[@KEY=current()]/@MO),'#0.00')"/>
         </TD>

         <xsl:if test="$XORZ='X'">
           <TD> ______</TD>
         </xsl:if>
         <xsl:if test="$XORZ='Z'">
           <TD></TD>
         </xsl:if>
       </TR>
     </xsl:for-each>
     </TABLE>
     <TABLE COLS="1,9,12,21,30,38">
       <TR>
         <TD>Total</TD>
         <TD ALIGN="RIGHT"><xsl:value-of select="SALE_LST_TND/@CNT"/></TD>
         <TD></TD>
         <TD ALIGN="RIGHT">
            <xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
            <xsl:value-of select="format-number(SALE_LST_TND/@MO,'#0.00')"/>
         </TD>
       </TR>
     </TABLE>
-->
		<L></L>
		<L>
			<B>PAYMENTS</B>
		</L>
		<L></L>
		<L>
			<B>PAYMENT</B>
		</L>

<!-- <xsl:for-each select="BAL_RPSTY/TND[@ID_CNY_ICD=0]"> -->

		<L>--------------------------------</L>
		<TABLE COLS="1,10,20,33">
			<xsl:for-each select="BAL_RPSTY/TND[@ID_CNY_ICD=0]">
				<TR>
					<TD>
						<xsl:value-of select="substring(@DE_TND,1,8)"/>
					</TD>
					<TD></TD>
					<TD></TD>
				</TR>

				<TR>
					<TD></TD>
					<TD>Expected</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_EXPCT"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>

				<TR>
					<TD></TD>
					<TD>Declared</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_DCLR"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>

				<TR>
					<TD></TD>
					<TD>Variance</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_VAR"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:for-each>

			<TR>
				<TD>Total</TD>
				<TD></TD>
				<TD></TD>
			</TR>
			<TR>
				<TD></TD>
				<TD>Expected</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="sum(BAL_RPSTY/TND[@ID_CNY_ICD=0]/@MO_EXPCT)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD></TD>
				<TD>Declared</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="sum(BAL_RPSTY/TND[@ID_CNY_ICD=0]/@MO_DCLR)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD></TD>
				<TD>Variance</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="sum(BAL_RPSTY/TND[@ID_CNY_ICD=0]/@MO_VAR)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<!-- Foriegn currency -->
		<L></L>
		<L></L>
		<L>
			<B>FOREIGN EXPECTED DCLARED VARIANC</B>
		</L>
		<L>--------------------------------</L>
		<TABLE COLS="1,9,17,25,33">
			<xsl:for-each select="BAL_RPSTY/TND[@ID_CNY_ICD!=0]">
				<TR>
					<TD>
						<xsl:value-of select="substring(@DE_TND,1,8)"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_EXPCT"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_DCLR"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_VAR"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:for-each>
		</TABLE>
		<L></L>
		<L></L>
		<L>
			<B>DISCOUNT</B>
		</L>
		<L>--------------------------------</L>
		<TABLE COLS="1,20,24,33">
			<xsl:for-each select="LST_DISC/DISC">
				<TR>
					<TD>
						<xsl:value-of select="substring(@DSC,1,18)"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@CNT"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:for-each>
		</TABLE>
		<L>--------------------------------</L>
		<TABLE COLS="1,20,24,33">
			<TR>
				<TD>TOTAL</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="LST_DISC/@CNT"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="LST_DISC/@MO"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<L></L>
		<L></L>

		<L><B>TAX</B></L>
		<L>--------------------------------</L>
		<TABLE COLS="1,10,20,33">
			<xsl:for-each select="LST_TX/TX">
				<TR>
					<TD>
						<xsl:value-of select="substring(@NM_TX,1,12)"/>
					</TD>
                </TR>
                <TR>
	               <TD></TD>
                   <TD>NET</TD>
					<TD ALIGN="RIGHT">
		                <xsl:call-template name="format-currency">
							<xsl:with-param name="value">
                               <xsl:value-of select="@MO_NET"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
                </TR>
                <TR>
                    <TD></TD>
	                <TD>TAX</TD>
					<TD ALIGN="RIGHT">
                        <xsl:call-template name="format-currency">
							<xsl:with-param name="value">
                            	<xsl:value-of select="@MO_TAX"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
                </TR>
                <TR>
	                <TD></TD>
                    <TD>GROSS</TD>
					<TD ALIGN="RIGHT">
                        <xsl:call-template name="format-currency">
							<xsl:with-param name="value">
                        		<xsl:value-of select="@MO"/>

							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:for-each>
			<TR>
				<TD>TOTAL</TD>
            </TR>
            <TR>
                <TD></TD>
                <TD>NET</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="sum(//LST_TX/TX/@MO_NET)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
            </TR>
            <TR>
	            <TD></TD>
                <TD>TAX</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="sum(//LST_TX/TX/@MO_TAX)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
            </TR>
            <TR>
	            <TD></TD>
                <TD>GROSS</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="sum(//LST_TX/TX/@MO)"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<L></L>
		<L></L>


		<!--
		<xsl:comment>
			<L>
				<B>ACCOUNT CREDIT/DEBIT TRANSACTIONS</B>
			</L>
			<L></L>
			<L>ACNT   NAME      TYPE   AMOUNT   TRAN#</L>


			<L>______________________________________</L>
			<TABLE COLS="1,8,18,25,31,39">
				<xsl:for-each select="LST_ACCOUNT_TRANS/TRN">
					<TR>
						<TD>
							<xsl:value-of select="@ID_ACNT_GL"/>
						</TD>
						<TD>
							<xsl:value-of select="substring(@NM_ACNT_GL,1,9)"/>
						</TD>
						<TD>
							<xsl:value-of select="@TY"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@MO"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@AI_TRN"/>
						</TD>
					</TR>
				</xsl:for-each>
			</TABLE>
			<L>______________________________________</L>
			<L></L>
			<L></L>


			<L>
				<B>CREDIT/DEBIT CARD TRANSACTIONS</B>
			</L>
			<L></L>
			<L>
			</L>
			<TABLE COLS="1,8,25,33,39">
				<TR>
					<TD>TENDER</TD>
					<TD>AUTH</TD>
					<TD>TRAN#</TD>
					<TD>AMOUNT</TD>
				</TR>
				<TR>
					<TD>______</TD>
					<TD>________________</TD>
					<TD>_______</TD>
					<TD>______</TD>
				</TR>

				<xsl:for-each select="LST_CREDITDEBIT_TRANS/TRN">
					<TR>
						<TD>
							<xsl:value-of select="@DSC"/>
						</TD>

						<TD>
							<xsl:call-template name="CCNUMBER">
								<xsl:with-param name="CD_CARD" select="@CD_CARD"/>
								<xsl:with-param name="DE_TRACK2" select="@DE_TRACK2"/>
							</xsl:call-template>
						</TD>


						<TD>
							<xsl:value-of select="@AI_TRN"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@MO"/>
						</TD>
					</TR>

					<xsl:if test="not(@REF_AUTHORIZER='')">
						<TR>
							<TD></TD>
							<TD>Auth: <xsl:value-of select="@REF_AUTHORIZER"/></TD>
							<TD></TD>
							<TD ALIGN="RIGHT"></TD>
						</TR>
					</xsl:if>
				</xsl:for-each>
			</TABLE>
			<L>______________________________________</L>
			<L></L>
			<L></L>
		</xsl:comment>

		<xsl:comment>
			<L>OPERATORS PERFORMANCE</L>
			<L>______________________________________</L>
			<L>NAME      TRN CVR   SALES DSC NS VD AVG</L>
			<L>______________________________________</L>
			<TABLE COLS="1,10,14,18,26,30,33,36,40">
				<xsl:for-each select="PERF_OPR/OPR">
					<TR>
						<TD>
							<xsl:value-of select="substring(@NM_OPR,1,9)"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@QU_TRN"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@QU_PARTY"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="@MO_TTL"/>
								</xsl:with-param>
							</xsl:call-template>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="@MO_DSC"/>
								</xsl:with-param>
							</xsl:call-template>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@QU_NOSALE"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@QU_CANCEL"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:if test="not (@QU_PARTY=0)">
								<xsl:value-of select="format-number(@MO_TTL div @QU_PARTY,'#0')"/>
							</xsl:if>
						</TD>
					</TR>
				</xsl:for-each>
			</TABLE>
			<L>______________________________________</L>
			<xsl:variable name="TotalPartySize" select="sum(//PERF_OPR/OPR/@QU_PARTY)"/>
			<xsl:variable name="TotalSales" select="sum(//PERF_OPR/OPR/@MO_TTL)"/>
			<TABLE COLS="1,10,14,18,26,30,33,36,40">
				<TR>
					<TD>TOTAL</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="sum(//PERF_OPR/OPR/@QU_TRN)"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="$TotalPartySize"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$TotalSales"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="sum(//PERF_OPR/OPR/@MO_DSC)"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="sum(//PERF_OPR/OPR/@QU_NOSALE)"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="sum(//PERF_OPR/OPR/@QU_CANCEL)"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalPartySize=0)">
							<xsl:value-of select="format-number($TotalSales div $TotalPartySize,'#0')"/>
						</xsl:if>
					</TD>
				</TR>
			</TABLE>
		</xsl:comment>
		-->
		<!--
     <TABLE COLS="1,14,18,30,38">
       <TR>
         <TD>Total</TD>
         <TD ALIGN="RIGHT"><xsl:value-of select="LST_HR/@CNT"/></TD>
         <TD ALIGN="RIGHT">
            <xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
            <xsl:value-of select="format-number(LST_HR/@MO,'#0.00')"/>
         </TD>
       </TR>
     </TABLE>
-->
		<L></L>
		<L></L>
		<xsl:if test="//POSTRANSACTION/@FL_SYS_PMS=-1">
			<xsl:if test="not(@READ_TYPE='XOperator')">
				<L>DEPARTMENTS BY TENDER</L>
				<L>--------------------------------</L>
				<TABLE COLS="1,18,33">
					<xsl:for-each select="LST_TND_DPT/TND">
						<TR>
							<TD>
								<xsl:value-of select="substring(@DSC,1,17)"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@MO"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
					</xsl:for-each>
				</TABLE>
				<L>--------------------------------</L>
				<TABLE COLS="1,18,33">
					<TR>
						<TD>Total</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="LST_TND_DPT/@MO"/>
								</xsl:with-param>
							</xsl:call-template>
						</TD>
					</TR>
				</TABLE>
				<L></L>
				<L></L>
				<L>PMS CHARGES</L>
				<L></L>
				<TABLE COLS="1,5,14,22,29,30,32"> 
					<TR>	
						<TD ALIGN="RIGHT">ROOM</TD>
						<TD ALIGN="RIGHT">REF</TD>
						<TD ALIGN="RIGHT">TRAN#</TD>
						<TD ALIGN="RIGHT">AMOUNT</TD>
						<TD></TD>
						<!--
						<TD>GUEST NAME</TD>
						-->
					</TR>
					<TR>
						<TD>----</TD>
						<TD ALIGN="RIGHT">-------</TD>
						<TD ALIGN="RIGHT">------</TD>
						<TD ALIGN="RIGHT">------</TD>
						<TD></TD>
						<!--
						<TD></TD>
						-->
					</TR>
					<xsl:for-each select="PMSPOSTING/PMSCHARGE">
						<TR>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="@room"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="@pmsref"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="@AI_TRN"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="TENDER/TRANSACTIONDETAIL/@MO"/>
							</TD>
							<TD></TD>
							<!--
							<TD>
								<xsl:value-of select="substring(@name,1,11)" />
							</TD>
							-->
						</TR>
						<xsl:for-each select="PRORATE_DPT">
							<TR>
								<!--
								<TD></TD>
								-->
								<TD></TD>
								<TD></TD>
								<TD ALIGN="RIGHT">
									<xsl:call-template name="format-currency">
										<xsl:with-param name="value">
											<xsl:value-of select="@MO"/>
										</xsl:with-param>
									</xsl:call-template>
								</TD>
								<TD></TD>
								<TD>
									<xsl:value-of select="@ID_DPT_POS"/>
								</TD>
							</TR>
						</xsl:for-each>
					</xsl:for-each>
				</TABLE>
				<L></L>
				<L></L>
			</xsl:if>
		</xsl:if>
		<xsl:if test="(//POSTRANSACTION/@FL_SYS_PMS=0) and not(contains(//POSTRANSACTION/@NM_TY_TRN,'SALE'))">
			<xsl:if test="not(@READ_TYPE='XOperator')">
				<L>DEPARTMENTS BY TENDER</L>
				<L>--------------------------------</L>
				<TABLE COLS="1,18,33">
					<xsl:for-each select="LST_TND_DPT/TND">
						<TR>
							<TD>
								<xsl:value-of select="substring(@DSC,1,17)"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@MO"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
					</xsl:for-each>
				</TABLE>
				<L>--------------------------------</L>
				<TABLE COLS="1,18,33">
					<TR>
						<TD>Total</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="LST_TND_DPT/@MO"/>
								</xsl:with-param>
							</xsl:call-template>
						</TD>
					</TR>
				</TABLE>
				<L></L>
				<L></L>
				<L>PMS CHARGES</L>
				<L></L>
				<TABLE COLS="1,5,14,22,29,30,32">
					<TR>
						<TD ALIGN="RIGHT">ROOM</TD>
						<TD ALIGN="RIGHT">REF</TD>
						<TD ALIGN="RIGHT">TRAN#</TD>
						<TD ALIGN="RIGHT">AMOUNT</TD>
						<TD></TD>
						<!--
						<TD>GUEST NAME</TD>
						-->
					</TR>
					<TR>
						<TD>----</TD>
						<TD ALIGN="RIGHT">-------</TD>
						<TD ALIGN="RIGHT">------</TD>
						<TD ALIGN="RIGHT">------</TD>
						<TD></TD>
						<!--
						<TD></TD>
						-->
					</TR>
					<xsl:for-each select="PMSPOSTING/PMSCHARGE">
						<TR>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="//POSTRANSACTION/@PMSID"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="@room"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="@pmsref"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="@AI_TRN"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="TENDER/TRANSACTIONDETAIL/@MO"/>
							</TD>
							<TD></TD>
							<!--
							<TD>
								<xsl:value-of select="substring(@name,1,11)" />
							</TD>
							-->
						</TR>
						<xsl:for-each select="PRORATE_DPT">
							<TR>
								<!--
								<TD></TD>
								-->
								<TD></TD>
								<TD></TD>
								<TD ALIGN="RIGHT">
									<xsl:call-template name="format-currency">
										<xsl:with-param name="value">
											<xsl:value-of select="@MO"/>
										</xsl:with-param>
									</xsl:call-template>
								</TD>
								<TD></TD>
								<TD>
									<xsl:value-of select="@ID_DPT_POS"/>
								</TD>
							</TR>
						</xsl:for-each>
					</xsl:for-each>
				</TABLE>
				<L></L>
				<L></L>
			</xsl:if>
		</xsl:if>

		<xsl:if test="(@READ_TYPE='X') or (@READ_TYPE='Z') or  (@READ_TYPE='XStore') or (@READ_TYPE='ZStore')">
			<L>Clock In/Out</L>
			<L></L>


			<TABLE COLS="1,14,21,27,33">
				<TR>
					<TD>Name</TD>
					<TD>Pos</TD>
					<TD>In</TD>
					<TD>Out</TD>
				</TR>
				<TR>
					<TD>------------</TD>
					<TD>------</TD>
					<TD>-----</TD>
					<TD>-----</TD>
				</TR>


				<xsl:for-each select="EMPLOYEECLOCK">
					<TR>
						<TD>
							<xsl:value-of select="@NM_EM"/>
						</TD>
						<TD>
							<xsl:if test="@ID_PST&gt;0">
								<xsl:value-of select="substring(@NM_PST,1,6)"/>
							</xsl:if>
							<xsl:if test="@ID_PST&lt;=0">
								<SP></SP>
							</xsl:if>
						</TD>
						<TD>
							<xsl:value-of select="@TS_CLCK_IN_S"/>
						</TD>
						<TD>
							<xsl:value-of select="@TS_CLCK_OUT_S"/>
						</TD>
					</TR>

					<xsl:if test="@TS_BRK_IN&gt;0">
						<TR>
							<TD></TD>
							<TD>Break</TD>
							<TD>
								<xsl:value-of select="@TS_BRK_IN_S"/>
							</TD>
							<TD>
								<xsl:value-of select="@TS_BRK_OUT_S"/>
							</TD>
						</TR>
					</xsl:if>

					<xsl:if test="@TS_BRK_IN1&gt;0">
						<TR>
							<TD></TD>
							<TD>Break</TD>
							<TD>
								<xsl:value-of select="@TS_BRK_IN_S1"/>
							</TD>
							<TD>
								<xsl:value-of select="@TS_BRK_OUT_S1"/>
							</TD>
						</TR>
					</xsl:if>
					<L></L>
				</xsl:for-each>
			</TABLE>
			<L>------------------------</L>
		</xsl:if>

		<TABLE COLS="1,33">
            <TR>
				<TD>Exchange Rate:</TD>
			</TR>
            <TR>
				<TD>1 USD = <xsl:value-of select="//POSTRANSACTION/@RATE_USD"/> VND</TD>
			</TR>
             <TR>
				<TD>1 EUR = <xsl:value-of select="//POSTRANSACTION/@RATE_EURO"/> VND</TD>
			</TR>
        </TABLE>
      	<L>------------------------</L>

	</xsl:template>

	<xsl:template match="Z-REPORT"></xsl:template>
	<xsl:template name="SERVERPERFORMANCE">
		<xsl:variable name="TotalTransactionAmount" select="LST_DPT_POS/@MO"/>
		<xsl:variable name="TotalTransactionCount" select="sum(//PERF_OPR/OPR/@QU_TRN)"/>
		<xsl:variable name="TotalPartySizeCount" select="sum(//PERF_OPR/OPR/@QU_PARTY)"/>
		<xsl:variable name="TotalCorrectionCount" select="sum(//PERF_OPR/OPR/@QU_ERRORCORRECT)"/>
		<xsl:variable name="TotalCorrectionAmount" select="sum(//PERF_OPR/OPR/@MO_ERRORCORRECT)"/>
		<xsl:variable name="TotalVoidCount" select="sum(//PERF_OPR/OPR/@QU_CANCEL)"/>
		<xsl:variable name="TotalVoidAmount" select="sum(//PERF_OPR/OPR/@MO_CANCEL)"/>
		<xsl:variable name="TotalNoSaleCount" select="sum(//PERF_OPR/OPR/@QU_NOSALE)"/>
		<xsl:variable name="TotalRefundCount" select="sum(//PERF_OPR/OPR/@QU_REFUND)"/>
		<xsl:variable name="TotalRefundAmount" select="sum(//PERF_OPR/OPR/@MO_REFUND)"/>
		<xsl:variable name="TotalCoverRemovedCount" select="sum(//PERF_OPR/OPR/@QU_COVERSUPRESS)"/>
		<xsl:variable name="TotalCoverRemovedAmount" select="sum(//PERF_OPR/OPR/@MO_COVERSUPRESS)"/>
		<TABLE COLS="1,22">
			<TR>
				<TD>DATE:</TD>
				<TD>
					<xsl:value-of select="@TS_TRN_BGN_DATE"/>
				</TD>
			</TR>
			<TR>
				<TD>TIME:</TD>
				<TD>
					<xsl:value-of select="@TS_TRN_BGN_TIME"/>
				</TD>
			</TR>
		</TABLE>
		<L></L>
		<L></L>
		<L>
			<B>STORE VALUES</B>
		</L>
		<L>--------------------------------------</L>
		<!--
     <L>12345678901234567890123456789012345678</L>
-->
		<TABLE COLS="1,24,30,39">
			<TR>
				<TD>TOTAL TRANSACTIONS</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$TotalTransactionCount"/>
				</TD>
			</TR>
			<TR>
				<TD>TOTAL SALES</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$TotalTransactionAmount"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD>TOTAL COVERS</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$TotalPartySizeCount"/>
				</TD>
			</TR>
			<TR></TR>
			<TR>
				<TD>ASPH</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:if test="not ($TotalPartySizeCount=0)">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$TotalTransactionAmount div $TotalPartySizeCount"/>
							</xsl:with-param>
						</xsl:call-template>
					</xsl:if>
				</TD>
			</TR>
			<TR></TR>
			<TR>
				<TD>NO SALES</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$TotalNoSaleCount"/>
				</TD>
			</TR>
			<TR>
				<TD>ERROR CORRECTS</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$TotalCorrectionCount"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$TotalCorrectionAmount"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD>% ERROR CORRECTS</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:if test="not (($TotalTransactionAmount+$TotalCorrectionAmount+$TotalVoidAmount)=0)">
						<xsl:value-of select="format-number($TotalCorrectionAmount div ($TotalTransactionAmount+$TotalCorrectionAmount+$TotalVoidAmount) ,'0%')"/>
					</xsl:if>
				</TD>
			</TR>
			<TR>
				<TD>VOIDS</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$TotalVoidCount"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$TotalVoidAmount"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD>% VOIDS</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:if test="not (($TotalTransactionAmount+$TotalCorrectionAmount+$TotalVoidAmount)=0)">
						<xsl:value-of select="format-number($TotalVoidAmount div ($TotalTransactionAmount+$TotalCorrectionAmount+$TotalVoidAmount), '0%')"/>
					</xsl:if>
				</TD>
			</TR>
			<TR>
				<TD>REFUNDS</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$TotalRefundCount"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$TotalRefundAmount"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
			<TR>
				<TD>COVERS REMOVED</TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="$TotalCoverRemovedCount"/>
				</TD>
				<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="$TotalCoverRemovedAmount"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
			</TR>
		</TABLE>
		<L>--------------------------------------</L>
		<L></L>
		<L></L>
		<xsl:for-each select="//PERF_OPR/OPR">
			<L></L>
			<L></L>
			<L>
				<B>OPERATOR NAME</B>
			</L>
			<L>--------------------------------------</L>
			<TABLE COLS="1,24,30,39">
				<TR>
					<TD>
						<xsl:value-of select="@NM_OPR"/>
					</TD>
					<TD></TD>
					<TD ALIGN="RIGHT">#<xsl:value-of select="@ID_OPR"/></TD>
				</TR>
				<TR></TR>
				<TR>
					<TD>TRANSACTIONS</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalTransactionCount=0)">
							<xsl:value-of select="format-number(@QU_TRN div $TotalTransactionCount,'0%')"/>
						</xsl:if>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@QU_TRN"/>
					</TD>
				</TR>
				<TR>
					<TD>SALES</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalTransactionAmount=0)">
							<xsl:value-of select="format-number(@MO_TTL div $TotalTransactionAmount,'0%')"/>
						</xsl:if>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_TTL"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD>COVERS</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalPartySizeCount=0)">
							<xsl:value-of select="format-number(@QU_PARTY div $TotalPartySizeCount,'0%')"/>
						</xsl:if>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@QU_PARTY"/>
					</TD>
				</TR>
				<TR>
					<TD>ASPH</TD>
					<TD></TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not (@QU_PARTY=0)">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="@MO_TTL div @QU_PARTY"/>
								</xsl:with-param>
							</xsl:call-template>
						</xsl:if>
					</TD>
				</TR>
				<TR>
					<TD>NO SALES</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalNoSaleCount=0)">
							<xsl:value-of select="format-number(@QU_NOSALE div $TotalNoSaleCount,'0%')"/>
						</xsl:if>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@QU_NOSALE"/>
					</TD>
				</TR>
				<TR>
					<TD>ERROR CORRECTS</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalCorrectionAmount=0)">
							<xsl:value-of select="format-number(@MO_ERRORCORRECT div $TotalCorrectionAmount,'0%')"/>
						</xsl:if>
						<xsl:if test="($TotalCorrectionAmount=0)">
							<xsl:value-of select="format-number(0,'0%')"/>
						</xsl:if>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_ERRORCORRECT"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD>VOIDS</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalVoidAmount=0)">
							<xsl:value-of select="format-number(@MO_CANCEL div $TotalVoidAmount,'0%')"/>
						</xsl:if>
						<xsl:if test="($TotalVoidAmount=0)">
							<xsl:value-of select="format-number(0,'0%')"/>
						</xsl:if>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_CANCEL"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD>REFUNDS</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalRefundAmount=0)">
							<xsl:value-of select="format-number(@MO_REFUND div $TotalRefundAmount,'0%')"/>
						</xsl:if>
						<xsl:if test="($TotalRefundAmount=0)">
							<xsl:value-of select="format-number(0,'0%')"/>
						</xsl:if>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_REFUND"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD>COVERS REMOVED</TD>
					<TD ALIGN="RIGHT">
						<xsl:if test="not ($TotalCoverRemovedAmount=0)">
							<xsl:value-of select="format-number(@MO_COVERSUPRESS div $TotalCoverRemovedAmount,'0%')"/>
						</xsl:if>
						<xsl:if test="($TotalCoverRemovedAmount=0)">
							<xsl:value-of select="format-number(0,'0%')"/>
						</xsl:if>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_COVERSUPRESS"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<!--
    -->
			</TABLE>
			<L>--------------------------------------</L>
		</xsl:for-each>
		<L></L>
		<L></L>
		<!--
     <L>12345678901234567890123456789012345678</L>
-->
		<!--
     <TABLE COLS="1,26,30,39">
     <TR>
       <TD>NO SALES</TD>
       <TD></TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="sum(//PERF_OPR/OPR/@QU_NOSALE)"/></TD>
     </TR>
     <TR>
       <TD>ERROR CORRECTS</TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="$CorrectionCount"/></TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="format-number($CorrectionAmount,'#0.00')"/></TD>
     </TR>
     <TR>
       <TD>% ERROR CORRECTS</TD>
       <TD></TD>
       <TD ALIGN="RIGHT">
         <xsl:if test="not ($CorrectionSales=0)">
			<xsl:value-of select="format-number($CorrectionAmount div $CorrectionSales ,'0%')"/>
         </xsl:if>
       </TD>
     </TR>
     <TR>
       <TD>VOIDS</TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="$VoidCount"/></TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="format-number($VoidAmount,'#0.00')"/></TD>
     </TR>
     <TR>
       <TD>% VOIDS</TD>
       <TD></TD>
       <TD ALIGN="RIGHT">
         <xsl:if test="not ($CorrectionSales=0)">
         	<xsl:value-of select="format-number($VoidAmount div $CorrectionSales, '0%')"/>
         </xsl:if>
       </TD>
     </TR>
     <TR>
       <TD>REFUNDS</TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="sum(//PERF_OPR/OPR/@QU_REFUND)"/></TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="format-number(sum(//PERF_OPR/OPR/@MO_REFUND),'#0.00')"/></TD>
     </TR>
     <TR>
       <TD>COVERS REMOVED</TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="sum(//PERF_OPR/OPR/@QU_COVERSUPRESS)"/></TD>
       <TD ALIGN="RIGHT"><xsl:value-of select="sum(//PERF_OPR/OPR/@MO_COVERSUPRESS)"/></TD>
     </TR>

     </TABLE>
-->
	</xsl:template>
	<xsl:template name="do-prorate">
		<xsl:param name="text"/>
		<xsl:choose>
			<xsl:when test="contains($text, ',')">
				<TR>
					<TD>
						<xsl:value-of select="substring(substring-before(substring-before($text, ','), '='),1,19)"/>
					</TD>

					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="substring-after(substring-before($text, ','), '=')"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
				<xsl:call-template name="do-prorate">
					<xsl:with-param name="text" select="substring-after($text, ',')"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<TR>
					<TD>
						<xsl:value-of select="substring(substring-before($text,'='),1,19)"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="substring-after($text, '=')"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="TRAN_DISCOUNT">
		<TR>
			<TD>
				<xsl:value-of select="DISCOUNT/TRANSACTIONDETAIL/@DSC"/>
			</TD>
			<TD></TD>
			<TD></TD>
			<TD></TD>
			<TD></TD>
			<TD ALIGN="RIGHT">
					<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="DISCOUNT/TRANSACTIONDETAIL/@MO"/>
							</xsl:with-param>
						</xsl:call-template>
			</TD>
			<TD></TD>
		</TR>
	</xsl:template>
	<xsl:template match="SUBTOTAL">
		<xsl:if test="SPLIT[@MO_TTL!=0]">
			<TR>
				<TD>SPLITS:</TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>
		</xsl:if>
		<xsl:for-each select="SPLIT[(@MO_TTL!=0) or (@MO_BAL!=0) or (@MO_TND!=0)]">
			<TR>
				<TD></TD>
				<TD></TD>
				<TD ALIGN="LEFT">#<xsl:value-of select="@ID_SPLIT"/>:<xsl:value-of select="@PERC_SPLIT"/></TD>
				<TD></TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="@MO_TTL"/>
				</TD>
			</TR>
		</xsl:for-each>
	</xsl:template>

	<xsl:template match="DISCOUNT">
		<xsl:if test="TRANSACTIONDETAIL/@MO!=0">
			<xsl:if test="(//POSTRANSACTION/TENDER/@TY_TND = 26)">
						<TR>
							<TD>Sub Total</TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
                                <xsl:variable name="V" select="number(//POSTRANSACTION/@MO_TTL)- sum(//POSTRANSACTION/DISCOUNT/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALEITEM[@FL_GRT=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO)"/>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="$V"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
							<TD></TD>
						</TR>
			</xsl:if>
			<TR>
				<TD>
					<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/>
				</TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
							</xsl:with-param>
						</xsl:call-template>
				</TD>
				<TD></TD>
			</TR>
			<xsl:if test="TRANSACTIONDETAIL/@ID_EXT!=''">
			<TR>
				<TD>Reference:<xsl:value-of select="TRANSACTIONDETAIL/@ID_EXT"/></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>
			</xsl:if>
		</xsl:if>
	</xsl:template>

	<xsl:template match="PMSCHARGE">
		<TR>
			<TD>
				<xsl:value-of select="TENDER/TRANSACTIONDETAIL/@DSC"/>
			</TD>
			<TD></TD>
			<TD></TD>
			<TD></TD>
			<TD></TD>
			<TD ALIGN="RIGHT">
				<xsl:if test="TENDER/TRANSACTIONDETAIL/@ID_SPLIT&gt;=0">#<xsl:value-of select="TENDER/TRANSACTIONDETAIL/@ID_SPLIT"/>:</xsl:if>
				<xsl:value-of select="TENDER/TRANSACTIONDETAIL/@MO"/>
			</TD>
			<TD></TD>
		</TR>
		<L>HOTEL:<xsl:value-of select="//POSTRANSACTION/@PMSID"/> </L>
		<L>PMS REF    :<xsl:value-of select="@pmsref"/></L>
		<L>ROOM NUMBER:<xsl:value-of select="@room"/></L>
		<L>GUEST NAME :<xsl:value-of select="@name"/></L>
	</xsl:template>


	<xsl:template name="multiDSCPrice">
		<xsl:param name="price"/>
		<TD></TD>
		<TD ALIGN="RIGHT">
			<xsl:value-of select="substring-before($price,'&#xD;')"/>
		</TD>
	</xsl:template>

	<xsl:template name="multiDSCText">
		<xsl:param name="line"/>
		<xsl:if test="string-length($line)&gt;0">
			<TR>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:value-of select="substring-before($line,'&#xD;')"/>
				</TD>
			</TR>
			<xsl:call-template name="multiDSCText">
				<xsl:with-param name="line" select="substring-after($line,'&#xD;')"/>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>


	<xsl:template name="multiDSCP">
		<xsl:param name="line"/>

		<xsl:if test="string-length($line)&gt;0">
			<xsl:if test="not (substring-before($line,'|')='')">
				<TR>
					<TD></TD>
					<TD>
						<xsl:value-of select="substring-before($line,'|')"/>
					</TD>

					<xsl:call-template name="multiDSCPrice">
						<xsl:with-param name="price" select="substring-after($line,'|')"/>
					</xsl:call-template>
				</TR>
				<xsl:call-template name="multiDSCP">
					<xsl:with-param name="line" select="substring-after($line,'&#xD;')"/>
				</xsl:call-template>
			</xsl:if>

			<xsl:if test="(substring-before($line,'|')='')">
				<xsl:call-template name="multiDSCText">
					<xsl:with-param name="line" select="concat($line,'&#xD;')"/>
				</xsl:call-template>
			</xsl:if>
		</xsl:if>
	</xsl:template>


	<xsl:template match="TENDER">
		<xsl:param name="DCLR"/>
		<TR>
			<TD>
				<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/>

				<xsl:if test="@ID_CNY_ICD">
					<xsl:if test="(@ID_CNY_ICD&gt;0)">
						<SP>
						</SP>
						<xsl:value-of select="@MO_CURR"/>
						<!--
						<xsl:call-template name="format-currency">
			           		<xsl:with-param name="value">
								<xsl:value-of select="@MO_CURR"/>
							</xsl:with-param>
			        	</xsl:call-template>						
				        -->
						<SP/>@<SP/>
						<xsl:value-of select="format-number(@MO_RT_TO_BUY,'#0.0000')"/>
					</xsl:if>
				</xsl:if>
			</TD>
			<TD></TD>
			<TD></TD>
			<TD></TD>
			<TD></TD>
			<TD ALIGN="RIGHT">
				<xsl:if test="TRANSACTIONDETAIL/@ID_SPLIT&gt;=0">#<xsl:value-of select="TRANSACTIONDETAIL/@ID_SPLIT"/>:</xsl:if>
				<xsl:choose>
					<xsl:when test="$DCLR">
						<xsl:value-of select="@MO_DCLR"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:if test="TRANSACTIONDETAIL/@FL_VD_LN_ITM=-1">*** Void ***</xsl:if>
						<xsl:if test="TRANSACTIONDETAIL/@FL_VD_LN_ITM=0">
							<xsl:if test="@ID_CNY_ICD">
									<xsl:call-template name="format-currency">
										<xsl:with-param name="value">
											<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
										</xsl:with-param>
									</xsl:call-template>
							</xsl:if>

							<xsl:if test="not(@ID_CNY_ICD)">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
									</xsl:with-param>
								</xsl:call-template>
							</xsl:if>
						</xsl:if>
					</xsl:otherwise>
				</xsl:choose>
			</TD>
			<TD></TD>
		</TR>



		<xsl:if test="@CNT">
			<TR>
				<TD>(<xsl:value-of select="@CNT"/> X <xsl:value-of select="@MO_CPN_TND"/>)</TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>
		</xsl:if>
		<xsl:if test="(@ID_CNY_ICD&gt;0) and (@CNT&gt;0)">
			<TR>
				<TD></TD>
				<TD></TD>
				<TD>
					<xsl:value-of select="@MO_CURR"/>
					<xsl:if test="@CNT!=0">
						<SP/>X<SP/>
						<xsl:value-of select="@CNT"/>
						<SP/>=<SP/>
						<xsl:value-of select="@MO_CPN_TND"/>
					</xsl:if>
					<SP/>@<SP/>
					<xsl:value-of select="@MO_RT_TO_BUY"/>
				</TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>
		</xsl:if>


		<xsl:if test="TRANSACTIONDETAIL/@DSC_P">
			<xsl:call-template name="multiDSCP">
				<xsl:with-param name="line" select="substring-after(TRANSACTIONDETAIL/@DSC_P,'&#xD;')"/>
			</xsl:call-template>
		</xsl:if>


		<xsl:if test="not (TRANSACTIONDETAIL/@DSC_P)">
			<xsl:if test="not (TRANSACTIONDETAIL/@NM_ACNT_GL='')">
				<TR>
					<TD></TD>
					<TD>
						<xsl:value-of select="TRANSACTIONDETAIL/@NM_ACNT_GL"/>
					</TD>
					<TD></TD>
					<TD>#<xsl:value-of select="TRANSACTIONDETAIL/@ID_ACNT_GL"/></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</xsl:if>
		</xsl:if>

		<xsl:if test="not (@ID_MEMBER='')">
			<TR>
				<TD></TD>
				<TD>
					Member : <xsl:value-of select="@ID_MEMBER"/>
				</TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>
			<TR>
				<TD></TD>
				<TD>
					Name   : <xsl:value-of select="@NM_MEMBER"/>
				</TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>
			<TR>
				<TD></TD>
				<TD>
					Balance:
					<xsl:call-template name="format-currency">
						<xsl:with-param name="value">
							<xsl:value-of select="@BAL_MEMBER"/>
						</xsl:with-param>
					</xsl:call-template>
				</TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>

		</xsl:if>		
		
	</xsl:template>
	<xsl:template name="TENDERDECLARE">
		<TR>
			<TD>
				<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/>
			</TD>
			<TD></TD>
			<TD></TD>
			<TD></TD>
			<TD></TD>
			<TD ALIGN="RIGHT">
				<xsl:value-of select="@MO_DCLR"/>
			</TD>
			<TD></TD>
		</TR>
	</xsl:template>
	<xsl:template match="GLITEM">
		<L>Reason Code:<xsl:value-of select="@ID_GL_RC"/></L>
		<L>Reason Name:<xsl:value-of select="@NM_GL_RC"/></L>
		<L>Comment    :<xsl:value-of select="@TXT_GL"/></L>
		<L></L>
	</xsl:template>
	<xsl:template match="TRANSACTIONDETAILINFO">
		<TR>
			<TD>
				<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/>
			</TD>
			<TD>
				<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
			</TD>
		</TR>
	</xsl:template>
	<xsl:template name="ITEMSEPARATOR">
		<TR>
			<TD>----</TD>
			<TD></TD>
			<TD>------------------</TD>
			<TD ALIGN="RIGHT">------</TD>
			<TD></TD>
			<TD ALIGN="RIGHT">------</TD>
			<TD></TD>
		</TR>
	</xsl:template>
	<xsl:template name="DEBUG">
		<xsl:param name="value"/>
		<TR>
			<TD>Debug : <xsl:value-of select="$value"/>:</TD>
		</TR>
	</xsl:template>

	<xsl:template name="PDRSEPARATOR">
		<xsl:param name="name"/>
		<TR>
			<TD>Promotion - <xsl:value-of select="$name"/>:</TD>
		</TR>
	</xsl:template>

	<xsl:template name="MSG_ITM_PRIM">
		<xsl:param name="MSG"/>
		<xsl:if test="not ($MSG='')">
			<TR>
				<TD></TD>
				<TD>- <xsl:value-of select="$MSG"/></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>
		</xsl:if>
	</xsl:template>

	<xsl:template name="MSG_ITM">
		<xsl:param name="MSG"/>

		<xsl:if test="not($MSG='')">
			<xsl:variable name="S" select="substring-after($MSG,'&#xA;')"/>
			<xsl:if test="not ($S='')">
				<xsl:call-template name="MSG_ITM_PRIM">
					<xsl:with-param name="MSG" select="substring-before($MSG,'&#xA;')"/>
				</xsl:call-template>
				<xsl:call-template name="MSG_ITM">
					<xsl:with-param name="MSG" select="substring-after($MSG,'&#xA;')"/>
				</xsl:call-template>
			</xsl:if>
			<xsl:if test="$S=''">
				<xsl:call-template name="MSG_ITM_PRIM">
					<xsl:with-param name="MSG" select="$MSG"/>
				</xsl:call-template>
			</xsl:if>
		</xsl:if>
	</xsl:template>

	<xsl:template name="morelines">
		<xsl:param name="value"/>
		<xsl:if test="not($value='')">
			<TR>
				<TD></TD>
				<TD></TD>
				<TD>
					<xsl:value-of select="substring($value,1,18)"/>
				</TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
				<TD></TD>
			</TR>

			<xsl:call-template name="morelines">
				<xsl:with-param name="value">
					<xsl:value-of select="substring($value,19,255)"/>
				</xsl:with-param>
			</xsl:call-template>

		</xsl:if>
	</xsl:template>





	<xsl:template match="SALEITEM">
		<xsl:param name="NESTED"/>
		<xsl:param name="split"/>

		<xsl:variable name="IsZeroItem">
			<xsl:choose>
				<xsl:when test="TRANSACTIONDETAIL/@MO=0">
					<xsl:value-of select="true()"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="false()"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		
		<xsl:variable name="IsVoid">
			<xsl:choose>
				<xsl:when test="(TRANSACTIONDETAIL/@FL_VD_LN_ITM=0) and (not (TRANSACTIONDETAIL/@FL_IS_SLP_PRT=0))">
					<xsl:value-of select="false()"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="true()"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="Description">
			<xsl:choose>
				<xsl:when test="@DSC_LONG!=''">
					<xsl:value-of select="@DSC_LONG"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:if test="(($IsVoid='false') or ($ShowVoids='true')) and (($IsZeroItem='false') or ($ShowZeroItems='true'))">
			<TR>
				<TD ALIGN="RIGHT">
					<xsl:if test="$NESTED='YES'">&#x20;
					</xsl:if>
					<xsl:if test="$NESTED='NO'">
						<xsl:value-of select="@QU"/>
					</xsl:if>
				</TD>
				<TD></TD>

				<TD>
					<xsl:if test="$NESTED='YES'">-</xsl:if>
					<xsl:choose>
						<xsl:when test="contains($Description,'/')">
							<xsl:value-of select="substring-before($Description,'/')"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="substring($Description,1,18)"/>
						</xsl:otherwise>
					</xsl:choose>
				</TD>


				<TD ALIGN="RIGHT">
					<!--
					<xsl:call-template name="format-currency">
			        	<xsl:with-param name="value">
							<xsl:value-of select="@CP_UN"/>
						</xsl:with-param>
			        </xsl:call-template>
					!-->
				</TD>
				<TD></TD>
				<TD ALIGN="RIGHT">
					<xsl:if test="$split&lt;=0">
						<xsl:if test="$NESTED='YES'"></xsl:if>
						<xsl:if test="$NESTED='NO'">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
								</xsl:with-param>
							</xsl:call-template>
						</xsl:if>
					</xsl:if>
				</TD>
				<TD></TD>
			</TR>

			<xsl:call-template name="morelines">
				<xsl:with-param name="value">
					<xsl:choose>
						<xsl:when test="contains($Description,'/')">
							<xsl:value-of select="substring-after($Description,'/')"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="substring($Description,19,255)"/>
								<xsl:choose>
								<xsl:when test="@WT&gt; 0">(<xsl:value-of select="@WT"/> G)</xsl:when>
							</xsl:choose>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:with-param>
			</xsl:call-template>

            <xsl:if test="@FACTOR_SPLT!=0">
            <TR>
				<TD></TD>
				<TD></TD>
				<TD>Split:<xsl:value-of select="@FACTOR_SPLT"/></TD>
			</TR>
			</xsl:if>


			<xsl:if test="@NM_EM_ML">
				<TR>
					<TD>Staff</TD>
					<TD>
						<xsl:value-of select="@NM_EM_ML"/>
					</TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</xsl:if>
			<xsl:if test="(not(//POSTRANSACTION/@ID_PRC_DEF=@ID_PRC)) and ($NESTED='NO')">
				<TR>
					<TD></TD>
					<TD></TD>
					<TD>Price Level <xsl:value-of select="@ID_PRC"/></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</xsl:if>
			<xsl:if test="TRANSACTIONDETAIL/@FL_VD=-1">
				<TR>
					<TD></TD>
					<TD>**** VOID ****</TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</xsl:if>
			<xsl:if test="TRANSACTIONDETAIL/@FL_ERR_CORRECT=-1">
				<TR>
					<TD></TD>
					<TD>**** CORRECTION ****</TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</xsl:if>

			<xsl:if test="(@FL_ITM_GWY=-1) and (//POSTRANSACTION/@TY_TRN!=153) ">
				<L>**** GIVEAWAY ****</L>
			</xsl:if>

			<xsl:if test="(@FL_WST=-1) and (//POSTRANSACTION/@TY_TRN!=153) ">
				<TR>
					<TD></TD>
					<TD>**** WASTE ****</TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</xsl:if>

			<xsl:if test="@PRC_OVR=-1">
				<TR>
					<TD></TD>
					<TD>**** PRICE OVERRIDE ****</TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</xsl:if>
			<xsl:if test="@QU&lt;0">
				<xsl:if test="not(@FL_MDF)">
					<TR>
						<TD></TD>
						<TD>**** REFUND ****</TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
					</TR>
				</xsl:if>
			</xsl:if>
			<xsl:if test="@SR_NMB!=''">
				<TR>
					<TD></TD>
					<TD>Serial:<xsl:value-of select="@SR_NMB"/></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
					<TD></TD>
				</TR>
			</xsl:if>
			<!--
            <xsl:if test="@ID_RU_PRDV!=0">
              <C>*** <xsl:value-of select="@NM_RU_PRDV"/> ***</C>
            </xsl:if>
            -->
			<!--
			<xsl:apply-templates select="SALEITEM">
				<xsl:with-param name="NESTED">YES</xsl:with-param>
				<xsl:with-param name="split" select="$split" />
			</xsl:apply-templates>

			<xsl:if test="@MSG_ITM">
	            <xsl:call-template name="MSG_ITM">
					<xsl:with-param name="MSG" select="@MSG_ITM" />
				</xsl:call-template>
			</xsl:if>
-->
			<xsl:for-each select="SPLIT">
				<xsl:if test="$split=-1">
					<TR>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="LEFT">SPLIT<xsl:if test="$split=-1"> #<xsl:value-of select="@ID_SPLIT"/></xsl:if>:<xsl:value-of select="@PERC_SPLIT"/> (<xsl:value-of select="normalize-space(@MO)"/>)</TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
					</TR>
				</xsl:if>
				<xsl:if test="$split=@ID_SPLIT">
					<TR>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="LEFT">SPLIT:<xsl:value-of select="@PERC_SPLIT"/></TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@MO"/>
						</TD>
					</TR>
				</xsl:if>
			</xsl:for-each>
		</xsl:if>
	</xsl:template>


	<xsl:template match="LOYALTY">
		<xsl:if test="@FL_STAFF_LYLT=1">
			<C>**************************************</C>
			<C>Staff Discount</C>
			<C>**************************************</C>
			<L></L>
			<TABLE COLS="1,22,34">
				<TR>
					<TD>Served By         :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="//POSTRANSACTION/@NM_OPR"/>
					</TD>
				</TR>
				<TR>
					<TD>Transaction       #</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="//POSTRANSACTION/@AI_TRN"/>
					</TD>
				</TR>
				<TR>
					<TD></TD>
				</TR>
				<TR>
					<TD>Staff Card Number :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@acctnum"/>
					</TD>
				</TR>
				<L></L>
				<TR>
					<TD>Points            :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@pointbalance"/>
					</TD>
				</TR>
				<xsl:if test="//POSTRANSACTION/PDRDETAIL/@VAL_RU_PRDV&gt;0">
					<L>Points Awarded</L>
					<xsl:for-each select="//POSTRANSACTION/PDRDETAIL">
						<xsl:if test="@VAL_RU_PRDV&gt;0">
							<TR>
								<TD>+<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/></TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="@VAL_RU_PRDV"/>
								</TD>
							</TR>
						</xsl:if>
					</xsl:for-each>
				</xsl:if>
				<xsl:if test="//POSTRANSACTION/PDRDETAIL/@VAL_RU_PRDV&lt;0">
					<L>Points Redeemed</L>
					<xsl:for-each select="//POSTRANSACTION/PDRDETAIL">
						<xsl:if test="@VAL_RU_PRDV&lt;0">
							<TR>
								<TD>-<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/></TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="@VAL_RU_PRDV"/>
								</TD>
							</TR>
						</xsl:if>
					</xsl:for-each>
				</xsl:if>
				<TR>
					<TD>Balance           :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@LYLT_PNT_NEW"/>
					</TD>
				</TR>
				<L></L>
				<L>Staff Signature</L>
				<L></L>
				<L></L>
				<C>-----------------------</C>
				<L></L>
				<L>Manager Signature</L>
				<L></L>
				<L></L>
				<C>----------------------</C>
				<L></L>
				<C>*****************************</C>
				<C>Your Saving For: <xsl:value-of select="//DISCOUNT/@NM_DSC"/></C>
				<C>******  <xsl:value-of select="//DISCOUNT/TRANSACTIONDETAIL/@MO"/>  ******</C>
				<C>*****************************</C>
				<L></L>
				<xsl:if test="@REGISTERED=0">
					<L></L>
					<C>******************</C>
					<C>
						<xsl:value-of select="@PWD_ACNT"/>
					</C>
					<C>******************</C>
					<L></L>
					<C>Please keep this receipt, as you will</C>
					<C>need this code to register.</C>
				</xsl:if>
				<L></L>
			</TABLE>
		</xsl:if>





		<xsl:if test="@FL_STAFF_LYLT=0">
			<L>**************************************</L>
			<C>Loyalty Details</C>
			<L>**************************************</L>
			<L></L>
			<TABLE COLS="1,22,34">
				<TR>
					<TD>Account Number :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@acctnum"/>
					</TD>
				</TR>
				<TR>
					<TD>Scheme Name    :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@schemerefid"/>
					</TD>
				</TR>
				<TR>
					<TD>Account Holder :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@name"/>
					</TD>
				</TR>
				<xsl:if test="(@registered=0)">
					<L>Not Registered Account</L>
				</xsl:if>
				<xsl:if test="@registered=-1">
					<L>Registered Account</L>
				</xsl:if>
				<xsl:if test="(@newaccount=0)">
					<L>Existing Account</L>
				</xsl:if>
				<xsl:if test="@newaccount=-1">
					<L>New Account</L>
				</xsl:if>
				<L></L>
				<TR>
					<TD>Points         :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@pointbalance"/>
					</TD>
				</TR>
				<xsl:if test="//POSTRANSACTION/PDRDETAIL/@VAL_RU_PRDV&gt;0">
					<L>Points Awarded</L>
					<xsl:for-each select="//POSTRANSACTION/PDRDETAIL">
						<xsl:if test="@VAL_RU_PRDV&gt;0">
							<TR>
								<TD>+<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/></TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="@VAL_RU_PRDV"/>
								</TD>
							</TR>
						</xsl:if>
					</xsl:for-each>
				</xsl:if>
				<xsl:if test="//POSTRANSACTION/PDRDETAIL/@VAL_RU_PRDV&lt;0">
					<L>Points Redeemed</L>
					<xsl:for-each select="//POSTRANSACTION/PDRDETAIL">
						<xsl:if test="@VAL_RU_PRDV&lt;0">
							<TR>
								<TD>-<xsl:value-of select="TRANSACTIONDETAIL/@DSC"/></TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="@VAL_RU_PRDV"/>
								</TD>
							</TR>
						</xsl:if>
					</xsl:for-each>
				</xsl:if>
				<TR>
					<TD>Balance        :</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@LYLT_PNT_NEW"/>
					</TD>
				</TR>
				<L></L>
				<L>Welcome to the Beer Miles Loyalty scheme</L>
				<L>Please Visit WWW.BEERMILES.COM</L>
				<xsl:if test="not (@PWD_ACNT='')">
					<L></L>
					<C>******************</C>
					<C>
						<xsl:value-of select="@PWD_ACNT"/>
					</C>
					<C>******************</C>
					<L></L>
					<C>Please keep this receipt, as you will</C>
					<C>need this code to register.</C>
				</xsl:if>
				<L></L>
			</TABLE>
		</xsl:if>
		<xsl:call-template name="FOOTER"/>
		<xsl:call-template name="CUT"/>
	</xsl:template>

	<xsl:template name="CREDITDEBIT">
		<xsl:param name="copy"/>

		<xsl:if test="TENDER/TRANSACTIONDETAIL/@FL_PRT=0">
			<!--
  <C><xsl:value-of select="TENDER/TRANSACTIONDETAIL/@FL_PRT"/></C>
-->
			<xsl:if test="TENDER/TRANSACTIONDETAIL/@FL_VD_LN_ITM=-1">
				<C>********************</C>
				<C>******  VOID  ******</C>
				<C>********************</C>
			</xsl:if>

			<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP1"/>
			</C>
			<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP2"/>
			</C>
			<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP3"/>
			</C>
			<!--<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP4"/>
			</C>
			<C>
				<xsl:value-of select="//POSTRANSACTION/@HEADER_SLIP5"/>
			</C>-->
			<L></L>
			<xsl:if test="$copy=1">
				<C>CUSTOMER</C>
				<C>COPY</C>
			</xsl:if>
			<xsl:if test="$copy=0">
				<C>MERCHANT</C>
				<C>COPY</C>
			</xsl:if>
			<xsl:if test="TENDER/TRANSACTIONDETAIL/@FL_VD_LN_ITM=-1">
				<C>******  VOID  ******</C>
			</xsl:if>

			<L></L>
			<TABLE COLS="1,22,40">
				<TR>
					<TD>MERCH.ID</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@ID_MRCHNT"/>
					</TD>
				</TR>
				<TR>
					<TD>REF.MERCH</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@REF_TRN_MRCHNT"/>
					</TD>
				</TR>
				<TR>
					<TD>AUTH NO</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@REF_AUTHORIZER"/>
					</TD>
				</TR>
				<TR>
					<TD>TRAN#</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="//POSTRANSACTION/@AI_TRN"/>
					</TD>
				</TR>
				<TR>
					<TD>CARD#</TD>
					<TD ALIGN="RIGHT">
						<xsl:call-template name="CCNUMBER">
							<xsl:with-param name="CD_CARD" select="@CD_CARD"/>
							<xsl:with-param name="DE_TRACK2" select="@DE_TRACK2"/>
						</xsl:call-template>
					</TD>
				</TR>
				<TR>
					<TD>VALID (MM/YY)</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="format-number(@MN_EXP,'#00')"/>/<xsl:value-of select="format-number(@YR_EXP,'#00')"/></TD>
				</TR>
				<TR>
					<TD>CARD</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="TENDER/@DE_TND"/>
					</TD>
				</TR>
				<TR>
					<TD>CUR</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="@CD_CURR"/>
					</TD>
				</TR>
				<TR>
					<TD>AMOUNT</TD>
					<TD ALIGN="RIGHT">
						<B>
							<xsl:value-of select="TENDER/TRANSACTIONDETAIL/@MO"/>
						</B>
					</TD>
				</TR>
				<TR></TR>
				<xsl:if test="not(TENDER/@MO_CSH_BCK=0)">
					<TR>
						<TD>CASH BACK (included)</TD>
						<TD ALIGN="RIGHT">
							<B>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="TENDER/@MO_CSH_BCK"/>
									</xsl:with-param>
								</xsl:call-template>
							</B>
						</TD>
					</TR>
				</xsl:if>

				<xsl:if test="not(//POSTRANSACTION/@TableMode=0)">
					<TR></TR>
					<TR>
						<TD>GRATUITY AMOUNT</TD>
						<TD ALIGN="RIGHT">
							<B>_________</B>
						</TD>
					</TR>
					<TR></TR>
					<xsl:if test="TENDER/@MO_TH_TND_CHN&gt;0">
						<TR>
							<TD>CASH BACK AMOUNT</TD>
							<TD ALIGN="RIGHT">
								<B>_________</B>
							</TD>
						</TR>
					</xsl:if>
					<TR></TR>
					<TR>
						<TD>TOTAL AMOUNT</TD>
						<TD ALIGN="RIGHT">
							<B>_________</B>
						</TD>
					</TR>
				</xsl:if>
			</TABLE>
			<L></L>
			<L></L>
			<xsl:if test="$copy=0 ">
				<L>SIGNATURE:_____________________________</L>
			</xsl:if>
			<L></L>
			<L></L>
			<L></L>
			<L></L>
			<L></L>
			<L></L>
			<L>
				<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,5,2)"/>/<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,3,2)"/>/<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,1,2)"/>
				<SP/>- <xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,7,2)"/>:<xsl:value-of select="substring(//POSTRANSACTION/@TS_TRN_END_S,9,2)"/></L>
			<xsl:call-template name="CUT"/>
		</xsl:if>
	</xsl:template>
	<xsl:template match="CREDITDEBIT">
		<xsl:call-template name="CREDITDEBIT">
			<xsl:with-param name="copy" select="0"/>
		</xsl:call-template>
		<xsl:call-template name="CREDITDEBIT">
			<xsl:with-param name="copy" select="1"/>
		</xsl:call-template>
	</xsl:template>

	<xsl:template name="DATACHANGE">
		<xsl:param name="RECORDS"/>

		<xsl:if test="$RECORDS">
			<xsl:for-each select="$RECORDS">
				<TR>
					<TD>
						<xsl:value-of select="@RPLC_OPR"/>
					</TD>
					<TD>
						<xsl:value-of select="@RPLC_TABLE"/>
					</TD>
					<TD>
						<xsl:value-of select="@ID_REC"/>
					</TD>
				</TR>

				<xsl:if test="@RPLC_TABLE='TR_RESERVE'">
					<TR>
						<TD>Name</TD>
						<TD>
							<xsl:value-of select="@DE_TRN"/>
						</TD>
					</TR>
					<TR>
						<TD>Acnt</TD>
						<TD>
							<xsl:value-of select="@ID_LYLT_ACNT"/>
						</TD>
					</TR>

					<TR>
						<TD>Date</TD>
						<TD>
							<xsl:value-of select="@DT_TRN_AS_STR"/>
						</TD>
					</TR>

					<TR>
						<TD>Nights</TD>
						<TD>
							<xsl:value-of select="@QU_DUR"/>
						</TD>
					</TR>
					<TR>
						<TD>Status</TD>
						<TD>
							<xsl:value-of select="@CD_RESERVE"/>
						</TD>
					</TR>

					<xsl:if test="not (@TS_IN=0)">
						<TR>
							<TD>In</TD>
							<TD>
								<xsl:value-of select="@TS_IN_AS_STR"/>
							</TD>
						</TR>
					</xsl:if>

					<xsl:if test="not (@TS_OUT=0)">
						<TR>
							<TD>Out</TD>
							<TD>
								<xsl:value-of select="@TS_OUT_AS_STR"/>
							</TD>
						</TR>
					</xsl:if>
					<L></L>
				</xsl:if>

				<xsl:if test="@RPLC_TABLE='CO_KBD_BTN_TS'">
					<TR>
						<TD>Caption</TD>
						<TD>
							<xsl:value-of select="@DE_BTN"/>
						</TD>
					</TR>
					<TR>
						<TD>Panel</TD>
						<TD>
							<xsl:value-of select="@ID_PNL"/>
						</TD>
					</TR>
					<L></L>
				</xsl:if>


				<xsl:if test="@RPLC_TABLE='AS_ITM'">
					<TR>
						<TD>Name</TD>
						<TD>
							<xsl:value-of select="@DE_ITM_POS"/>
						</TD>
					</TR>

					<TR>
						<TD>Merchandise</TD>
						<TD>
							<xsl:value-of select="@ID_STRC_MR"/>
						</TD>
					</TR>

					<TR>
						<TD>POS Dpt</TD>
						<TD>
							<xsl:value-of select="@ID_DPT_POS"/>
						</TD>
					</TR>
					<L></L>
				</xsl:if>
			</xsl:for-each>
		</xsl:if>
	</xsl:template>

	<xsl:template name="PAEMDATACHANGE">
		<xsl:param name="RECORDS"/>
		<xsl:if test="$RECORDS">
			<xsl:for-each select="$RECORDS">
				<TR>
					<TD>User ID:</TD>
					<TD>
						<xsl:value-of select="@ID_EM"/>
					</TD>
				</TR>

				<TR>
					<TD>User Name:</TD>
					<TD>
						<xsl:value-of select="@NM_EM"/>
					</TD>
				</TR>

				<TR>
					<TD>Card:</TD>
					<TD>
						<xsl:if test="@DE_EM_MG_CRD=''">NA</xsl:if>
						<xsl:if test="not (@DE_EM_MG_CRD='')">
							<xsl:value-of select="@DE_EM_MG_CRD"/>
						</xsl:if>
					</TD>
				</TR>

				<TR>
					<TD>Status:</TD>
					<TD>
						<xsl:if test="@SC_EM='NONACTIVE'">Deleted</xsl:if>
						<xsl:if test="@SC_EM!='NONACTIVE'">
							<xsl:value-of select="@SC_EM"/>
						</xsl:if>
					</TD>
				</TR>
			</xsl:for-each>
		</xsl:if>
	</xsl:template>


	<xsl:template name="PDRS">
		<xsl:param name="RECORDS"/>
		<xsl:if test="$RECORDS">
			<xsl:for-each select="$RECORDS">
				<xsl:sort select="@ID_RU_PRDV" data-type="number" order="ascending"/>
				<xsl:variable name="id" select="@ID_RU_PRDV"/>
				<xsl:if test="position()=1">
					<xsl:if test="@NM_RU_PRDV!=''">
						<TR>
							<TD>Promotion - <xsl:value-of select="$RECORDS[1]/@NM_RU_PRDV"/>:</TD>
						</TR>
					</xsl:if>
					<xsl:variable name="split" select="//POSTRANSACTION/@ID_SPLT"/>
					<xsl:apply-templates select="$RECORDS[@ID_RU_PRDV=$id]">
						<xsl:with-param name="NESTED">NO</xsl:with-param>
						<xsl:with-param name="split" select="$split"/>
					</xsl:apply-templates>
					<xsl:call-template name="PDRS">
						<xsl:with-param name="RECORDS" select="$RECORDS[@ID_RU_PRDV!=$id]"/>
					</xsl:call-template>
				</xsl:if>
			</xsl:for-each>
		</xsl:if>
	</xsl:template>


	<xsl:template name="RPTDAT7">
		<xsl:param name="RECORDS"/>
		<xsl:if test="$RECORDS">
			<xsl:for-each select="$RECORDS">
				<TR>
					<TD>
						<xsl:value-of select="@ID_ACNT"/>
					</TD>
					<TD>
						<xsl:value-of select="@NM_ACNT"/>
					</TD>
					<TD>
						<xsl:value-of select="@DT_CREATED"/>
					</TD>
					<TD align="right">
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="@MO_DEPOSIT"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
					<TD align="right">
						<xsl:variable name="V" select="@MO_DEPOSIT - @MO_REDEEM"/>
						<xsl:call-template name="format-currency">
							<xsl:with-param name="value">
								<xsl:value-of select="$V"/>
							</xsl:with-param>
						</xsl:call-template>
					</TD>
				</TR>
			</xsl:for-each>
		</xsl:if>
	</xsl:template>








	<xsl:template name="RPTDATS">
		<xsl:param name="RECORDS"/>
		<xsl:if test="$RECORDS">
			<xsl:for-each select="$RECORDS">
				<TR>
					<TD>
						<xsl:value-of select="substring(@NM_OPR,1,6)"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="substring(@ID_TBL,1,4)"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="substring(@QU_PARTY,1,3)"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="substring(@MO_TTL,1,6)"/>
					</TD>
					<TD></TD>
					<TD>
						<xsl:value-of select="substring(@CYC_NM_TBL,1,8)"/>
					</TD>
					<TD ALIGN="RIGHT">
						<xsl:value-of select="substring(@TS_TRN_BGN,1,5)"/>
					</TD>
				</TR>
			</xsl:for-each>
		</xsl:if>
	</xsl:template>





	<xsl:template match="POSTRANSACTION">

		<xsl:variable name="split" select="//POSTRANSACTION/@ID_SPLT"/>
		<C>
			<xsl:value-of select="@HEADER_SLIP1"/>
		</C>
		<C>
			<xsl:value-of select="@HEADER_SLIP2"/>
		</C>
		<C>
			<xsl:value-of select="@HEADER_SLIP3"/>
		</C>
		<!--<C>
			<xsl:value-of select="@HEADER_SLIP4"/>
		</C>
		<C>
			<xsl:value-of select="@HEADER_SLIP5"/>
		</C>
		<L></L>-->

		<xsl:if test="@FL_BILL=-1">
			<C>
				<W>CUSTOMER BILL</W>
			</C>
			<C># <xsl:value-of select="@AI_TRN"/> Table: <xsl:value-of select="@NM_TBL"/></C>
			<C>
				<W>PRINT #<xsl:value-of select="@BILL_PRN_CNT"/></W>
			</C>
		</xsl:if>
		<xsl:if test="@FL_BILL=0">

			<xsl:if test="(@TY_TRN!=103)">
				<C><H><xsl:value-of select="@NM_TY_TRN"/></H></C>
                	<C><W><H>#<xsl:value-of select="@AI_TRN"/></H></W></C>
			</xsl:if>

			<xsl:if test="(@TY_TRN=103)">
					<!--
						fix: 1 line of receipt	
						<W>Receipt </W>-->
				<C># <xsl:value-of select="@AI_TRN"/> Table: <xsl:value-of select="@NM_TBL"/></C>					
			</xsl:if>



			<xsl:if test="@MO_TTL&lt;0">
				<C>Refund</C>
			</xsl:if>


			<xsl:if test="@INF_LBL">
				<C>
					<B>
						<H>
							<xsl:value-of select="@INF_LBL"/>
						</H>
					</B>
				</C>
			</xsl:if>
		</xsl:if>

		<xsl:if test="@CD_TRG_TRN=1">
			<C>Training Mode (S)</C>
		</xsl:if>

		<xsl:if test="@CD_TRG_TRN=2">
			<C>Training Mode (E)</C>
		</xsl:if>

		<xsl:if test="@NM_CT=''">
			<L>Customer:</L>
			<L>Name: <xsl:value-of select="@NM_CT"/></L>
			<L>Addr: <xsl:value-of select="@NM_ADDR"/></L>
			<L>VAT :  <xsl:value-of select="@NM_VAT"/></L>
			<L></L>
		</xsl:if>



		<xsl:if test="$split&gt;0">
			<C>SPLIT:<xsl:value-of select="$split"/></C>
			<xsl:variable name="des" select="LST_SPLIT/SPLIT[@ID_SPLIT=$split]/@NM_SPLIT"/>
			<xsl:if test="$des">
				<C>Split Reference: <xsl:value-of select="$des"/></C>
			</xsl:if>
		</xsl:if>
		<xsl:if test="@FL_PST_VD=-1">
			<C>*** POSTVOID ***</C>
		</xsl:if>
		<xsl:if test="@ID_CT_KEY">
			<C>Loyalty: <xsl:value-of select="@ID_CT_KEY"/></C>
		</xsl:if>
		<xsl:if test="@NM_GL_RC">
			<C>Account: <xsl:value-of select="@NM_GL_RC"/></C>
		</xsl:if>
		<xsl:if test="string-length(@ID_SPR)&gt;0">
			<C>From:<xsl:value-of select="@NM_SPR"/></C>
			<C>To:<xsl:value-of select="@NM_LCN_STK"/></C>
		</xsl:if>
		<xsl:if test="@REF">
			<C>Reference: <xsl:value-of select="@REF"/></C>
		</xsl:if>
		<!--<xsl:if test="@ID_TBL">
			<C>Table: <xsl:value-of select="@NM_TBL"/></C>
		</xsl:if>-->
        <!--
		<xsl:for-each select="//DISCOUNT/TRANSACTIONDETAIL[@FL_VD_LN_ITM=0 and not (@ID_EXT='')]">
			<C><W>VIP: <xsl:value-of select="@ID_EXT"/></W></C>
		</xsl:for-each>
        -->
		<xsl:if test="not (@NM_ACNT_GL='')">
			<C>Account: <xsl:value-of select="@NM_ACNT_GL"/></C>
			<C>#<xsl:value-of select="@ID_ACNT_GL"/></C>
		</xsl:if>
		<xsl:if test="(not (@DC_EP_STR='')) and (not (@DC_EP='0'))">
			<C>Date: <xsl:value-of select="@DC_EP_STR"/></C>
		</xsl:if>
		
		<xsl:if test="@FL_SUSPND=-1">
			<C>**** TRANSACTION SUSPENDED ****</C>
		</xsl:if>
		<xsl:if test="@FL_VD=-1">
			<C>**** TRANSACTION CANCELED ****</C>
		</xsl:if>
		
		<xsl:if test="(@TY_TRN=115)">
			<C>SHIFT: <xsl:value-of select="@ID_SHFT"/></C>
		</xsl:if>
		<xsl:if test="(@TY_TRN=101) or (@TY_TRN=102)">
			<C>
				<xsl:value-of select="SIGNINOUT/TRANSACTIONDETAIL/@DSC"/>
			</C>
			<L></L>
			<C>Location: <xsl:value-of select="SIGNINOUT/@ID_LCN_SLS"/></C>
			<xsl:if test="(SIGNINOUT/@FL_MO_BELT!=0)">
				<C>Money Belt</C>
			</xsl:if>
			<xsl:if test="(SIGNINOUT/@FL_TRG_TRN!=0)">
				<C>Training Mode</C>
			</xsl:if>
			<L></L>
		</xsl:if>

		<xsl:if test="(@TY_TRN=155)">
			<xsl:choose>
				<xsl:when test="RECORD[@RPLC_TABLE='PA_EM']">
					<TABLE COLS="1,10,39">
						<xsl:call-template name="PAEMDATACHANGE">
							<xsl:with-param name="RECORDS" select="RECORD[@RPLC_TABLE='PA_EM']"/>
						</xsl:call-template>
					</TABLE>
				</xsl:when>

				<xsl:otherwise>

					<TABLE COLS="1,10,27,39">
						<TR>
							<TD>OP</TD>
							<TD>TABLE</TD>
							<TD>ID_REC</TD>
						</TR>
						<TR>
							<TD>-------</TD>
							<TD>----------</TD>
							<TD>-------</TD>
						</TR>
						<xsl:call-template name="DATACHANGE">
							<xsl:with-param name="RECORDS" select="RECORD[@RPLC_TABLE='TR_RESERVE']"/>
						</xsl:call-template>


						<xsl:call-template name="DATACHANGE">
							<xsl:with-param name="RECORDS" select="RECORD[@RPLC_TABLE='CO_KBD_BTN_TS']"/>
						</xsl:call-template>

						<xsl:call-template name="DATACHANGE">
							<xsl:with-param name="RECORDS" select="RECORD[@RPLC_TABLE='AS_ITM']"/>
						</xsl:call-template>
					</TABLE>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>


		<xsl:if test="(@TY_TRN=151)">
			<xsl:for-each select="EMPLOYEECLOCK">
				<L>
					<xsl:value-of select="@NM_CLCK"/>
				</L>
				<L>
					<xsl:value-of select="@ID_EM"/>
				</L>
				<L>
					<xsl:value-of select="@NM_EM"/>
				</L>
				<xsl:if test="@TS_CLCK_IN_S or @TS_CLCK_OUT_S">
					<L>
						<xsl:text>IN/OUT </xsl:text>
						<xsl:value-of select="@TS_CLCK_IN_S"/>
						<xsl:text>-</xsl:text>
						<xsl:value-of select="@TS_CLCK_OUT_S"/>
					</L>
				</xsl:if>

				<xsl:if test="@TS_BRK_IN_S or @TS_BRK_OUT_S">
					<L>
						<xsl:text>BREAK </xsl:text>
						<xsl:value-of select="@TS_BRK_IN_S"/>
						<xsl:text>-</xsl:text>
						<xsl:value-of select="@TS_BRK_OUT_S"/>
					</L>
				</xsl:if>

				<xsl:if test="@TS_BRK_IN_S1 or @TS_BRK_OUT_S1">
					<L>
						<xsl:text>BREAK(2) </xsl:text>
						<xsl:value-of select="@TS_BRK_IN_S1"/>
						<xsl:text>-</xsl:text>
						<xsl:value-of select="@TS_BRK_OUT_S1"/>
					</L>
				</xsl:if>


				<L></L>
			</xsl:for-each>
		</xsl:if>


		<xsl:if test="count(STOCKDETAIL)&gt;0">
			<xsl:choose>
				<xsl:when test="(@TY_TRN=160)">
					<xsl:for-each select="STOCKDETAIL">
						<L>Location:<xsl:value-of select="@ID_ITM"/></L>
					</xsl:for-each>
				</xsl:when>

				<xsl:otherwise>
					<TABLE COLS="1,20,30">
						<TR>
							<TD ALIGN="LEFT">ITEM</TD>
							<TD ALIGN="LEFT">UOM</TD>
							<TD ALIGN="RIGHT">QTY</TD>
						</TR>

						<TR>
							<TD ALIGN="LEFT">===================</TD>
							<TD ALIGN="LEFT">========</TD>
							<TD ALIGN="RIGHT">========</TD>
						</TR>


						<xsl:for-each select="STOCKDETAIL">
							<TR>

								<TD ALIGN="LEFT">
									<xsl:value-of select="substring(TRANSACTIONDETAIL/@DSC,1,19)"/>
								</TD>

								<TD ALIGN="LEFT">
									<xsl:value-of select="substring(@NM_UOM_CNT,1,9)"/>
								</TD>

								<TD ALIGN="RIGHT">
									<xsl:value-of select="format-number(@CNT,'#0.0')"/>
								</TD>
							</TR>
						</xsl:for-each>
					</TABLE>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>

		<!--
    Price Change
-->

		<xsl:if test="(@TY_TRN=154)">
			<TABLE COLS="1,18,28,32">
				<TR>
					<TD>ITEM</TD>
					<TD ALIGN="RIGHT">OLD PRICE</TD>
					<TD ALIGN="RIGHT">NEW PRICE</TD>
				</TR>
				<TR>
					<TD>=================</TD>
					<TD ALIGN="RIGHT">=========</TD>
					<TD ALIGN="RIGHT">=========</TD>
				</TR>
				<xsl:for-each select="SALEITEM">
					<TR>
						<TD>
							<xsl:value-of select="substring(TRANSACTIONDETAIL/@DSC,1,17)"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@CP_UN_BS"/>
						</TD>
						<TD ALIGN="RIGHT">
							<xsl:value-of select="@CP_UN"/>
						</TD>
					</TR>
				</xsl:for-each>
			</TABLE>
		</xsl:if>


		<xsl:if test="((@TY_TRN=103) or (@TY_TRN=153)) and (not(@PRINT_OPT=60))">
			<xsl:variable name="isbill" select="//POSTRANSACTION/@FL_BILL=-1"/>
			<xsl:if test="@NM_DST">
				<C>Destination: <xsl:value-of select="@NM_DST"/></C>
				<L></L>
			</xsl:if>
			<TABLE>
				<xsl:attribute name="COLS">
					<xsl:if test="$PrintFormat='Narrow'">1,3,4,22,22,22,33</xsl:if>
					<xsl:if test="not ($PrintFormat='Narrow')">1,3,4,25,25,35,36</xsl:if>
				</xsl:attribute>

				<xsl:if test="SALEITEM">
					<TR>
						<TD ALIGN="RIGHT">QT</TD>
						<TD></TD>
						<TD>NAME</TD>
						<TD ALIGN="RIGHT"></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">AMOUNT</TD>
						<TD></TD>
					</TR>
					<TR>
						<TD>==</TD>
						<TD></TD>
						<TD>===================</TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">=======</TD>
						<TD></TD>
					</TR>
				</xsl:if>
				<xsl:choose>
					<xsl:when test="(@PRINT_OPT=1)">
						<xsl:for-each select="SALEITEM[not(@ID_DPT_POS=preceding-sibling::SALEITEM/@ID_DPT_POS)]">
							<xsl:variable name="dep" select="@ID_DPT_POS"/>
							<xsl:variable name="depname" select="@NM_DPT_POS"/>
							<TR>
								<TD></TD>
								<TD></TD>
								<TD>
									<xsl:value-of select="substring($depname,1,16)"/>
								</TD>
								<TD></TD>
								<TD></TD>
								<TD ALIGN="RIGHT">
									<xsl:if test="$split&gt;0">
										<xsl:variable name="value" select="sum(//SALEITEM[(@ID_DPT_POS=$dep)]/SPLIT[@ID_SPLIT=$split]/@MO)"/>
										<xsl:call-template name="format-currency">
											<xsl:with-param name="value">
												<xsl:value-of select="$value"/>
											</xsl:with-param>
										</xsl:call-template>
									</xsl:if>
									<xsl:if test="$split&lt;=0">
										<xsl:if test="$isbill">
											<xsl:variable name="value" select="sum(//SALEITEM[(@ID_DPT_POS=$dep) and (not(SPLIT))]/TRANSACTIONDETAIL/@MO)"/>
											<xsl:call-template name="format-currency">
												<xsl:with-param name="value">
													<xsl:value-of select="$value"/>
												</xsl:with-param>
											</xsl:call-template>
										</xsl:if>
										<xsl:if test="not ($isbill)">
											<xsl:variable name="value" select="sum(//SALEITEM[(@ID_DPT_POS=$dep)]/TRANSACTIONDETAIL/@MO)"/>
											<xsl:call-template name="format-currency">
												<xsl:with-param name="value">
													<xsl:value-of select="$value"/>
												</xsl:with-param>
											</xsl:call-template>
										</xsl:if>
									</xsl:if>
								</TD>
								<TD></TD>
							</TR>
						</xsl:for-each>
					</xsl:when>
					<xsl:otherwise>
						<xsl:if test="//POSTRANSACTION/@ID_SPLT&gt;0">
							<xsl:for-each select="SALEITEM[not(TRANSACTIONDETAIL/@SORT=preceding-sibling::SALEITEM/TRANSACTIONDETAIL/@SORT)]">
								<xsl:sort select="TRANSACTIONDETAIL/@SORT" order="ascending"/>
								<xsl:if test="position()&gt;1">
									<xsl:call-template name="ITEMSEPARATOR"/>
								</xsl:if>
								<xsl:call-template name="PDRS">
									<xsl:with-param name="RECORDS" select="//POSTRANSACTION/SALEITEM[(SPLIT/@ID_SPLIT=//POSTRANSACTION/@ID_SPLT) and TRANSACTIONDETAIL/@SORT=current()/TRANSACTIONDETAIL/@SORT]"/>
								</xsl:call-template>
								<!--
                           <xsl:apply-templates select="//POSTRANSACTION/SALEITEM[(SPLIT/@ID_SPLIT=//POSTRANSACTION/@ID_SPLT) and TRANSACTIONDETAIL/@SORT=current()/TRANSACTIONDETAIL/@SORT]">
                              <xsl:with-param name="NESTED">NO</xsl:with-param>
                              <xsl:with-param name="split" select="$split"/>
                           </xsl:apply-templates>
                           -->
							</xsl:for-each>
						</xsl:if>
						<xsl:if test="//POSTRANSACTION/@ID_SPLT&lt;=0">
							<xsl:if test="//POSTRANSACTION/@FL_BILL=-1">
								<xsl:for-each select="SALEITEM[(not(TRANSACTIONDETAIL/@SORT=preceding-sibling::SALEITEM/TRANSACTIONDETAIL/@SORT))]">
									<xsl:sort select="TRANSACTIONDETAIL/@SORT" order="ascending"/>
									<xsl:if test="position()&gt;1">
										<xsl:call-template name="ITEMSEPARATOR"/>
									</xsl:if>

									<xsl:call-template name="PDRS">
										<xsl:with-param name="RECORDS" select="//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (TRANSACTIONDETAIL/@SORT=current()/TRANSACTIONDETAIL/@SORT) and (@FL_SVC_CHRG=0) and (@FL_GRT=0)]"/>
									</xsl:call-template>
									<!--
									-->
									<!--
                       <xsl:apply-templates   select="//POSTRANSACTION/SALEITEM[(not(SPLIT)) and TRANSACTIONDETAIL/@SORT=current()/TRANSACTIONDETAIL/@SORT]">
                          <xsl:with-param name="NESTED">NO</xsl:with-param>
                          <xsl:with-param name="split" select="$split"/>
                       </xsl:apply-templates>
                      -->
								</xsl:for-each>
								<!--
                    <xsl:apply-templates select="SALEITEM[not(SPLIT)]">
                       <xsl:with-param name="NESTED">NO</xsl:with-param>
                    </xsl:apply-templates>
                    -->
							</xsl:if>
							<!-- Sale transaction no split -->
							<xsl:if test="//POSTRANSACTION/@FL_BILL=0">
								<xsl:for-each select="SALEITEM[not(TRANSACTIONDETAIL/@SORT=preceding-sibling::SALEITEM/TRANSACTIONDETAIL/@SORT)]">
									<xsl:sort select="TRANSACTIONDETAIL/@SORT" data-type="number" order="ascending"/>
									<xsl:if test="position()&gt;1">
										<xsl:call-template name="ITEMSEPARATOR"/>
									</xsl:if>
									<xsl:call-template name="PDRS">
										<xsl:with-param name="RECORDS" select="//POSTRANSACTION/SALEITEM[(TRANSACTIONDETAIL/@SORT=current()/TRANSACTIONDETAIL/@SORT) and (@FL_SVC_CHRG=0) and (@FL_GRT=0)] "/>
									</xsl:call-template>
								</xsl:for-each>
							</xsl:if>
						</xsl:if>
					</xsl:otherwise>
				</xsl:choose>

				<xsl:if test="SALEITEM">
					<TR>
						<TD>==</TD>
						<TD></TD>
						<TD>====================</TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">========</TD>
						<TD></TD>
					</TR>

					<xsl:if test="//POSTRANSACTION/@ID_SPLT=0">

                        <xsl:apply-templates select="DISCOUNT"/>
						<xsl:apply-templates select="TRAN_DISCOUNT"/>
  					    	<xsl:if test="not(//POSTRANSACTION/TENDER/@TY_TND = 26)">
						<TR>
							<TD>Sub Total</TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
                                <xsl:variable name="V" select="number(//POSTRANSACTION/@MO_TTL)-sum(//POSTRANSACTION/SALEITEM[@FL_SVC_CHRG=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALEITEM[@FL_GRT=-1]/TRANSACTIONDETAIL/@MO)-sum(//POSTRANSACTION/SALESTAX/TRANSACTIONDETAIL/@MO)"/>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="$V"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
							<TD></TD>
						</TR>
						</xsl:if>
						<xsl:if test="sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_SVC_CHRG=-1)]/TRANSACTIONDETAIL/@MO)!=0">
						
						<TR>
							<TD>Service Charge</TD>	
									<TD></TD>
									<TD></TD>
									<TD ALIGN="RIGHT"></TD>
									<TD></TD>
									<TD ALIGN="RIGHT">
										   <xsl:call-template name="format-currency">
											  <xsl:with-param name="value">
												<xsl:value-of select="1 * sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_SVC_CHRG=-1)]/TRANSACTIONDETAIL/@MO)"/>
											  </xsl:with-param>
										   </xsl:call-template>
									</TD>
									<TD></TD>
						</TR>
						</xsl:if>


						<xsl:if test="(@FL_BILL=0) or (@FL_BILL=-1)">
							<xsl:for-each select="SALESTAX">
								<xsl:if test="TRANSACTIONDETAIL/@MO!=0">

								<TR>
									<TD></TD>	
									<TD></TD>
									<TD></TD>
									<TD></TD>
									<TD></TD>
									<TD ALIGN="RIGHT">--------</TD>	
									<TD></TD>
								</TR>
								<TR>
									<TD>SubTotal VAT</TD>	
									<TD></TD>
									<TD></TD>
									<TD ALIGN="RIGHT"></TD>
									<TD></TD>
									<TD ALIGN="RIGHT"><xsl:call-template name="format-currency">
											  <xsl:with-param name="value">
												<xsl:value-of select="@MO_TX"/>
											  </xsl:with-param>
										   </xsl:call-template>
									</TD>	
									<TD></TD>
								</TR>

								<TR>
									<TD><xsl:value-of select="TRANSACTIONDETAIL/@DSC"/></TD>	
									<TD></TD>
									<TD></TD>
									<TD ALIGN="RIGHT"></TD>
									<TD></TD>
									<TD ALIGN="RIGHT">
										<xsl:call-template name="format-currency">
											<xsl:with-param name="value">
												<xsl:value-of select="TRANSACTIONDETAIL/@MO"/>
											</xsl:with-param>
										</xsl:call-template>
									</TD>
									<TD></TD>
								</TR>

								
								
								
								</xsl:if>




							</xsl:for-each>
						</xsl:if>

						<xsl:if test="sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_GRT=-1)]/TRANSACTIONDETAIL/@MO)!=0">
						<TR>
							<TD>Tips</TD>	
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT"></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="sum(//POSTRANSACTION/SALEITEM[(not(SPLIT)) and (@FL_GRT=-1)]/TRANSACTIONDETAIL/@MO)"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
							<TD></TD>
						</TR>
						</xsl:if>

						<xsl:apply-templates select="SUBTOTAL"/>
					</xsl:if>
					<L></L>
					
					
					<TR>
						<TD><H>Total VND</H></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">
							<H><xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="//POSTRANSACTION/@MO_TTL"/>
								</xsl:with-param>
							</xsl:call-template></H>
						</TD>
					</TR>
					<L></L>
				<!--	<TR>
						<TD>Foreign Currency:</TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
					</TR>
					
					<xsl:if test="@EUR_MO_TTL">
					<TR>
						<TD></TD>
						<TD></TD>
						<TD><xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@RATE_EURO"/>
									</xsl:with-param>
								</xsl:call-template> VND = 1 EUR</TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">
								<xsl:value-of select="format-number(//POSTRANSACTION/@EUR_MO_TTL,'##,##0.00')"/>
						</TD>
					</TR>
					</xsl:if>


					<xsl:if test="@USD_MO_TTL">
					<TR>
						<TD></TD>
						<TD></TD>
						<TD><xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@RATE_USD"/>
									</xsl:with-param>
								</xsl:call-template> VND = 1 USD</TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT"><xsl:value-of select="format-number(@USD_MO_TTL,'##,##0.00')"/></TD>
					</TR>
					</xsl:if>

				-->	
					<xsl:if test="(@FL_EURO=-99) and ($split&lt;=0)">
						<L></L>
						<TR>
							<TD>Euro @ <xsl:value-of select="format-number(@RATE_EURO,'#0.000')"/></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="//POSTRANSACTION/@EUR_MO_TTL"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
						<TR>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT"></TD>
						</TR>
						<TR>
							<TD>
								<xsl:value-of select="//POSTRANSACTION/@NM_CNY_ICD"/>Total</TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@MO_TTL"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
						<TR>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">------</TD>
						</TR>
					</xsl:if>
					<!-- -->
					<xsl:if test="(@FL_EURO=-1) and ($split&gt;0)">
						<L></L>
						<TR>
							<TD>Euro @ <xsl:value-of select="format-number(@RATE_EURO,'#0.000')"/></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="SUBTOTAL/SPLIT[@ID_SPLIT=$split]/@EUR_MO_TTL"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
						<TR>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">------</TD>
						</TR>
						<TR>
							<TD>
								<xsl:value-of select="//POSTRANSACTION/@NM_CNY_ICD"/>Total</TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@MO_TTL"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
						<TR>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD></TD>
							<TD ALIGN="RIGHT">------</TD>
						</TR>
					</xsl:if>
					<!-- -->

					<xsl:for-each select="LST_DPT_POS/DPT_POS">
						<TR>
							<TD>(<xsl:value-of select="@KEY"/>)</TD>
							<TD>
								<xsl:value-of select="@DSC"/>
							</TD>
							<TD ALIGN="RIGHT">
								<xsl:value-of select="//POSTRANSACTION/@SYMB_CNY____"/>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@MO"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
					</xsl:for-each>
					<TR>
						<TD></TD>
					</TR>



					<TR>
						<TD>Received:</TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">------------</TD>
					</TR>
				</xsl:if>

				<xsl:if test="//POSTRANSACTION/@ID_SPLT&gt;=0">
					<xsl:apply-templates select="CREDITDEBIT/TENDER[TRANSACTIONDETAIL/@ID_SPLIT=//POSTRANSACTION/@ID_SPLT]"/>
					<xsl:apply-templates select="TENDER[TRANSACTIONDETAIL/@ID_SPLIT=//POSTRANSACTION/@ID_SPLT]"/>

					<xsl:apply-templates select="PMSCHARGE[TENDER/TRANSACTIONDETAIL/@ID_SPLIT=//POSTRANSACTION/@ID_SPLT]"/>
				</xsl:if>

				<xsl:if test="//POSTRANSACTION/@ID_SPLT=0">
					<xsl:for-each select="CREDITDEBIT">
						<xsl:apply-templates select="TENDER"/>
						<L>CARD#<xsl:call-template name="CCNUMBER">
								<xsl:with-param name="CD_CARD" select="@CD_CARD"/>
								<xsl:with-param name="DE_TRACK2" select="@DE_TRACK2"/></xsl:call-template><xsl:if test="@REF_AUTHORIZER!=''">   Auth:<xsl:value-of select="@REF_AUTHORIZER"/></xsl:if></L>
						<L></L>
					</xsl:for-each>
					<xsl:apply-templates select="TENDER[TRANSACTIONDETAIL/@FL_VD_LN_ITM=0]"/>
					<xsl:apply-templates select="PMSCHARGE"/>
				</xsl:if>


			<xsl:if test="@FL_BILL=-1">
					<TR>
						<TD>Balance:</TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT">
							<B><xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="number(//POSTRANSACTION/@MO_TTL)-sum(//TENDER[TRANSACTIONDETAIL/@FL_VD_LN_ITM=0]/TRANSACTIONDETAIL/@MO)"/>
								</xsl:with-param>
								</xsl:call-template></B>
						</TD>
					</TR>
				<!--	<TR>
						<TD></TD>
						<TD></TD>
						<TD>EUR</TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT"><xsl:value-of select="format-number(//POSTRANSACTION/@EUR_MO_BAL,'##,##0.00')"/></TD>
					</TR>
					<TR>
						<TD></TD>
						<TD></TD>
						<TD>USD</TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="RIGHT"><xsl:value-of select="format-number(//POSTRANSACTION/@USD_MO_BAL,'##,##0.00')"/></TD>
					</TR> -->
			</xsl:if>

			</TABLE>
			<!--
			<xsl:if test="@PMSREF!=''">
				<L></L>
				<L></L>
				<L>HOTEL: <xsl:value-of select="//POSTRANSACTION/@PMSID"/></L>
				<L>PMS REF    :<xsl:value-of select="@pmsref"/></L>
				<L>ROOM NUMBER:<xsl:value-of select="@room"/></L>
				<L>GUEST NAME :<xsl:value-of select="@NM_CT"/></L>
				<L></L>
				<L></L>
				<L></L>
			</xsl:if>-->
			<L></L>
			<L>COVERS :<xsl:value-of select="@QU_PARTY"/></L>
			<L></L>
	<!--		<xsl:if test="@FL_SYS_PMS=-1">
				<L>PRINT NAME  :__________________</L>
				<L></L>
				<L>ROOM NUMBER :__________________</L>
				<L></L>
				<L>SIGNATURE   :__________________</L>
				<xsl:if test="@FL_GRATS=-1">
					<L></L>
					<L>TIPS        :__________________</L>
					<L></L>
				</xsl:if>
			</xsl:if>

			<xsl:if test="@FL_KY_OFL=-1">
				<L></L>
				<L></L>
				<L>*** OFF LINE POSTING ***</L>
				<L></L>
				<L></L>
			</xsl:if>



			<L></L>
-->

			<xsl:if test="@MO_PRDV&gt;0">
				<L></L>
				<C>
					<B>*****************************</B>
				</C>
				<C>
					<B>**** Your Saving: <xsl:value-of select="@MO_PRDV"/> ****</B>
				</C>
				<C>
					<B>*****************************</B>
				</C>
				<L></L>
			</xsl:if>


<!--
			<xsl:if test="//POSTRANSACTION/@TY_TRN=153">
				<C>Signature:____________________</C>
				<L></L>
				<C>Comments:_____________________</C>
				<C>______________________________</C>
				<C>______________________________</C>
			</xsl:if>

		need customer signature if refund v 2.91 
			
			<xsl:if test="count(//POSTRANSACTION/SALEITEM[@QU&lt;0])&gt;0">
				<L></L>
				<L>Customer Details</L>
				<L></L>
				<C>Name:_________________________</C>
				<C>Address:______________________</C>
				<C>______________________________</C>
				<C>Card:_________________________</C>
				<L></L>
				<C>Signature:____________________</C>
			</xsl:if>

			<xsl:choose>
			  	<xsl:when test="//POSTRANSACTION/SALEITEM[not(@FL_SVC_CHRG=0)]">
				  <xsl:for-each select="//POSTRANSACTION/SALEITEM[not(@FL_SVC_CHRG=0)]/TRANSACTIONDETAIL">
						<xsl:if test="position()=1">
					    	<C><xsl:value-of select="@DSC"/>&#x20;Included</C>
						</xsl:if>
				  </xsl:for-each>
				</xsl:when>
				<xsl:otherwise>
				  <C>Service Charge Not Included</C>
				</xsl:otherwise>
			</xsl:choose>

-->
		<!--	<C><w><xsl:value-of select="@FOOTER_SLIP1"/></w>
	
			</C>
			<C>
				<xsl:value-of select="@FOOTER_SLIP2"/>
			</C>-->
			<!--
			<C>
				<xsl:value-of select="@FOOTER_SLIP3"/>
			</C>
			<C>
				<xsl:value-of select="@FOOTER_SLIP4"/>
			</C>
			<C>
				<xsl:value-of select="@FOOTER_SLIP5"/>
			</C>-->
		<!--	<xsl:if test="(not (@FL_BILL=-1)) and (@TY_TRN=103)">
				<C>VAT No : <xsl:value-of select="@DE_VAT"/></C>
			</xsl:if>-->
			<!--
       <L><Q>Q4</Q><B>BBB</B><U>UUU</U><W>WWW</W><H>HHH</H></L>

			<L></L>-->
			<xsl:if test="(@FL_BILL=0) and (@ID_SPLT=0) and (@FL_SYS_PMS=-1)">
				<L>DEPARTMENT SPLIT</L>
				<L>================================</L>
				<TABLE COLS="1,20,33">
					<xsl:call-template name="do-prorate">
						<xsl:with-param name="text" select="@PRORATE_DPT"/>
					</xsl:call-template>
				<L>================================</L>
				
				<TR>
					<TD>Total</TD>
					<TD ALIGN="RIGHT">
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="@PRORATE_DPT_TOTAL"/>
									</xsl:with-param>
								</xsl:call-template>
					</TD>
				</TR>

				<xsl:variable name="v1">
					<xsl:value-of select="sum(//POSTRANSACTION/SALESTAX[TRANSACTIONDETAIL/@MO!=0]/@MO_TX)+sum(//POSTRANSACTION/SALEITEM[@FL_GRT=-1]/TRANSACTIONDETAIL/@MO)"/>
				</xsl:variable>
				<xsl:variable name="v2">
					<xsl:value-of select="@PRORATE_DPT_TOTAL"/>
				</xsl:variable>
				<xsl:variable name="delta">
					<xsl:value-of select="$v1 - $v2"/>
				</xsl:variable>
				
				<xsl:if test="$delta!=0">
					<TR>
						<TD>Imbalance</TD>	
						<TD ALIGN="RIGHT">
							<xsl:call-template name="format-currency">
								<xsl:with-param name="value">
									<xsl:value-of select="$delta"/>
						    	</xsl:with-param>
							</xsl:call-template>
						</TD>	
				    </TR>
				</xsl:if>
	
			</TABLE>
				<L></L>

			</xsl:if>
		</xsl:if>

		<xsl:if test="@TY_TRN!=103">
			<TABLE COLS="1,5,6,14,23,24,33">
				<xsl:apply-templates select="GLITEM"/>


				<xsl:choose>
					<xsl:when test="@TY_TRN=102">
						<xsl:if test="@FL_SUSPND=-1">
							<xsl:apply-templates select="TENDER[@MO_DCLR!=0]">
								<xsl:with-param name="DCLR">true</xsl:with-param>
							</xsl:apply-templates>
						</xsl:if>
						<xsl:if test="@FL_SUSPND=0">
							<xsl:apply-templates select="TENDER"/>
						</xsl:if>
					</xsl:when>
					<xsl:otherwise>
						<xsl:apply-templates select="TENDER"/>
					</xsl:otherwise>
				</xsl:choose>

				<xsl:if test="count(TENDER)&gt;1">
					<TR>
						<TD>Total</TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD></TD>
						<TD ALIGN="LEFT">
							<xsl:value-of select="@MO_TND"/>
						</TD>
						<TD></TD>
					</TR>
				</xsl:if>
			</TABLE>
		</xsl:if>





		<xsl:if test="(@TY_TRN=158)">
			<TABLE COLS="1,20">
				<TR>
					<TD>TYPE:</TD>
					<TD ALIGN="LEFT">
						<xsl:if test="TRANSACTIONDETAILINFO/@TY_SETTING=0">Price Level</xsl:if>
					</TD>
				</TR>
				<TR>
					<TD>VALUE:</TD>
					<TD ALIGN="LEFT">
						<xsl:value-of select="TRANSACTIONDETAILINFO/@DE_SETTING"/>
					</TD>
				</TR>
				<TR>
					<TD>DES:</TD>
					<TD ALIGN="LEFT">
						<xsl:value-of select="TRANSACTIONDETAILINFO/TRANSACTIONDETAIL/@DSC"/>
					</TD>
				</TR>
			</TABLE>
		</xsl:if>
		<xsl:if test="(@TY_TRN=136)">
			<!--
       <C><xsl:value-of select="READ-REPORT/@READ_TYPE"/></C>
-->
			<!--
        <xsl:if test="(READ-REPORT/@READ_TYPE='XOperator')">
	      <C>For Operator :<xsl:value-of select="READ-REPORT/@XREAD_NM_OPR"/></C>
	      <C>Till :<xsl:value-of select="READ-REPORT/@ID_TL"/></C>
        </xsl:if>
-->
			<L></L>
			<xsl:choose>
				<xsl:when test="READ-REPORT/@READ_TYPE='Server Performance'">
					<xsl:for-each select="READ-REPORT">
						<xsl:call-template name="SERVERPERFORMANCE"/>
					</xsl:for-each>
				</xsl:when>
				<xsl:otherwise>
					<xsl:apply-templates select="READ-REPORT">
						<xsl:with-param name="XORZ">X</xsl:with-param>
					</xsl:apply-templates>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>

		<xsl:if test="(@TY_TRN=149)">
			<C>
				<xsl:value-of select="ALERT/@DE_ALRT"/>
			</C>
		</xsl:if>

		<xsl:if test="(@TY_TRN=134)">


			<C>Z / READ</C>
			<L></L>
			<xsl:apply-templates select="READ-REPORT">
				<xsl:with-param name="XORZ">Z</xsl:with-param>
			</xsl:apply-templates>
		</xsl:if>
		<xsl:if test="(@TY_TRN=116)">
			<C>Z / READ</C>
			<L></L>
			<xsl:apply-templates select="READ-REPORT">
				<xsl:with-param name="XORZ">Z</xsl:with-param>
			</xsl:apply-templates>
		</xsl:if>
		<xsl:if test="(@TY_TRN=102)">
			<!--
      <xsl:if test="not (//POSTRANSACTION/READ-REPORT/@READ_TYPE='ZOperator')">
-->
			<L></L>
			<C>
				<xsl:value-of select="//POSTRANSACTION/READ-REPORT/@READ_TYPE"/>
			</C>
			<xsl:apply-templates select="READ-REPORT">
				<xsl:with-param name="XORZ">Z</xsl:with-param>
			</xsl:apply-templates>
			<!--
      </xsl:if>
-->
		</xsl:if>
		<xsl:if test="(@TY_TRN=122)">
			<TABLE COLS="1,15,27,30,31,32">
				<xsl:for-each select="XMLTRANSACTIONDETAIL">
					<xsl:if test="@KEY='TY_TRN'">
						<xsl:choose>
							<xsl:when test="@NM_TY_TRN='MO_TND'">
								<TR>
									<TD>------------</TD>
									<TD></TD>
									<TD ALIGN="RIGHT">---</TD>
									<TD></TD>
									<TD ALIGN="RIGHT">--------</TD>
									<TD></TD>
								</TR>
								<TR>
									<TD>TOTAL</TD>
									<TD>
										<xsl:value-of select="@DE_TND"/>
									</TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="@CNT"/>
									</TD>
									<TD></TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="@MO"/>
									</TD>
									<TD></TD>
								</TR>
							</xsl:when>
							<xsl:otherwise>
								<TR>
									<TD>
										<xsl:value-of select="@NM_TY_TRN"/>
									</TD>
									<TD>
										<xsl:value-of select="@DE_TND"/>
									</TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="@CNT"/>
									</TD>
									<TD></TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="@MO"/>
									</TD>
									<TD></TD>
								</TR>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:if>
				</xsl:for-each>
				<L></L>
				<xsl:for-each select="XMLTRANSACTIONDETAIL">
					<xsl:if test="@KEY='TY_TRN_TY_TND'">
						<xsl:choose>
							<xsl:when test="@NM_TY_TRN='MO_TND'">
								<TR>
									<TD>------------</TD>
									<TD>------------</TD>
									<TD ALIGN="RIGHT">---</TD>
									<TD></TD>
									<TD ALIGN="RIGHT">-------</TD>
									<TD></TD>
								</TR>
								<TR>
									<TD>TOTAL</TD>
									<TD>
										<xsl:value-of select="@DE_TND"/>
									</TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="@CNT"/>
									</TD>
									<TD></TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="@MO"/>
									</TD>
									<TD></TD>
								</TR>
							</xsl:when>
							<xsl:otherwise>
								<TR>
									<TD>
										<xsl:value-of select="@NM_TY_TRN"/>
									</TD>
									<TD>
										<xsl:value-of select="@DE_TND"/>
									</TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="@CNT"/>
									</TD>
									<TD></TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="@MO"/>
									</TD>
								</TR>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:if>
				</xsl:for-each>
				<!-- xsl:apply-templates select="XMLTRANSACTIONDETAIL/@KEY=TY_TRN"-->
				<!-- xsl:sort select="XMLTRANSACTIONDETAIL/@TY_TRN" data-type="number"/-->
				<!-- /xsl:apply-templates-->
			</TABLE>
			<L></L>
		</xsl:if>
		<!--Loan Pickup requires manager approval -->
		<xsl:if test="(@TY_TRN=120) or (@TY_TRN=121)">
			<L></L>
			<L>
				<xsl:text>Approval:______________________ </xsl:text>
			</L>
			<L></L>
			<L>Till #<xsl:value-of select="@ID_TL"/> Owner: <xsl:value-of select="@NM_TL_OWN"/></L>
			<L></L>
		</xsl:if>
		<xsl:if test="(@TY_TRN=152)">
			<L></L>
			<xsl:choose>
				<xsl:when test="REPORT/RPT_HDR/@REPORT_TYPE=1">
					<C>OPEN ORDERS REPORT</C>
					<L></L>
					<TABLE COLS="1,7,13,17,24,25,34,40">
						<TR>
							<TD>OPR</TD>
							<TD ALIGN="RIGHT">TBL</TD>
							<TD ALIGN="RIGHT">CV</TD>
							<TD ALIGN="RIGHT">AMOUNT</TD>
							<TD></TD>
							<TD>STATUS</TD>
							<TD ALIGN="RIGHT">TIME</TD>
						</TR>
						<TR>
							<TD>------</TD>
							<TD ALIGN="RIGHT">----</TD>
							<TD ALIGN="RIGHT">---</TD>
							<TD ALIGN="RIGHT">------</TD>
							<TD></TD>
							<TD>--------</TD>
							<TD ALIGN="RIGHT">-----</TD>
						</TR>
						<xsl:for-each select="REPORT/RPT_DAT">
							<xsl:sort select="@NM_LCN" order="ascending"/>
							<xsl:if test="not(@NM_LCN=preceding-sibling::RPT_DAT/@NM_LCN)">
								<xsl:if test="position()&gt;1">
									<L></L>
								</xsl:if>
								<TR>
									<TD>Area <xsl:value-of select="@NM_LCN"/></TD>
									<TD></TD>
									<TD></TD>
									<TD></TD>
									<TD></TD>
									<TD></TD>
								</TR>
								<xsl:call-template name="RPTDATS">
									<xsl:with-param name="RECORDS" select="../RPT_DAT[@NM_LCN=current()/@NM_LCN]"/>
								</xsl:call-template>
							</xsl:if>
						</xsl:for-each>
					</TABLE>
				</xsl:when>
				<xsl:when test="REPORT/RPT_HDR/@REPORT_TYPE=2">
					<C>INVENTORY BALANCE REPORT</C>
					<L></L>
					<TABLE COLS="1,19,26,33,40">
						<TR>
							<TD>ITEM</TD>
							<TD ALIGN="RIGHT">BALANCE</TD>
							<TD ALIGN="RIGHT">IN</TD>
							<TD ALIGN="RIGHT">OUT</TD>
						</TR>
						<TR>
							<TD>-----------------</TD>
							<TD ALIGN="RIGHT">-------</TD>
							<TD ALIGN="RIGHT">------</TD>
							<TD ALIGN="RIGHT">------</TD>
						</TR>
						<xsl:for-each select="REPORT/RPT_DAT">
							<TR>
								<TD>
									<xsl:value-of select="substring(@NM_ITM,1,10)"/>
								</TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="format-number(@QU_BGN_BLNC,'#0.0')"/>
								</TD>
							</TR>
							<TR>
								<TD>Sales/Waste</TD>
								<TD ALIGN="RIGHT"></TD>
								<TD ALIGN="RIGHT"></TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="format-number(@QU_SLS+@QU_WASTE,'#0.0')"/>
								</TD>
							</TR>
							<xsl:if test="not (@QU_ING='')">
								<TR>
									<TD>Ingredients</TD>
									<TD ALIGN="RIGHT"></TD>
									<TD ALIGN="RIGHT"></TD>
									<TD ALIGN="RIGHT">
										<xsl:value-of select="format-number(@QU_ING,'#0.0')"/>
									</TD>
								</TR>
							</xsl:if>
							<TR>
								<TD>Receive/Return</TD>
								<TD ALIGN="RIGHT"></TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="format-number(@QU_RCV,'#0.0')"/>
								</TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="format-number(@QU_RTN,'#0.0')"/>
								</TD>
							</TR>
							<TR>
								<TD>Transfer In/Out</TD>
								<TD></TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="format-number(@QU_TSF_IN,'#0.0')"/>
								</TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="format-number(@QU_TSF_OT,'#0.0')"/>
								</TD>
							</TR>
							<TR>
								<TD>Adjustment</TD>
								<TD ALIGN="RIGHT">
									<xsl:if test="@QU_ADJT&gt;0">
										<xsl:value-of select="format-number(@QU_ADJT,'#0.0')"/>
									</xsl:if>
								</TD>
								<TD ALIGN="RIGHT">
									<xsl:if test="@QU_ADJT&lt;0">
										<xsl:value-of select="format-number(@QU_ADJT,'#0.0')"/>
									</xsl:if>
								</TD>
							</TR>
							<TR>
								<TD>Balance</TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="format-number(@QU_BLNC,'#0.0')"/>
								</TD>
							</TR>
							<TR></TR>
						</xsl:for-each>
					</TABLE>
					<C>----------------------------------------</C>
				</xsl:when>
				<xsl:when test="REPORT/RPT_HDR/@REPORT_TYPE=3">
					<C>Open Terminals Report</C>
					<L></L>
					<TABLE COLS="1,12,24,32,38">
						<TR>
							<TD>Location</TD>
							<TD>Terminal</TD>
							<TD ALIGN="RIGHT">Total</TD>
							<TD ALIGN="RIGHT">Time</TD>
						</TR>
						<TR>
							<TD>----------</TD>
							<TD>-----------</TD>
							<TD>--------</TD>
							<TD>-----</TD>
						</TR>
						<xsl:for-each select="REPORT/RPT_DAT">
							<TR>
								<TD>
									<xsl:value-of select="substring(@NM_LCN,1,11)"/>
								</TD>
								<TD>
									<xsl:value-of select="substring(@NM_WS,1,11)"/>
								</TD>
								<TD ALIGN="RIGHT">
									<xsl:call-template name="format-currency">
										<xsl:with-param name="value">
											<xsl:value-of select="@MO_TRN"/>
										</xsl:with-param>
									</xsl:call-template>
								</TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="@TS_OPEN"/>
								</TD>
							</TR>
						</xsl:for-each>
					</TABLE>
				</xsl:when>

				<xsl:when test="REPORT/RPT_HDR/@REPORT_TYPE=4">
					<C>Reservations Report</C>
					<L></L>
					<TABLE COLS="1,7,16,25,38">
						<TR>
							<TD>Time</TD>
							<TD>Tables</TD>
							<TD>Duration</TD>
							<TD>Name</TD>
						</TR>
						<TR>
							<TD>-----</TD>
							<TD>--------</TD>
							<TD>--------</TD>
							<TD>------------</TD>
						</TR>
						<xsl:for-each select="REPORT/RPT_DAT">
							<TR>
								<TD>
									<xsl:value-of select="@TS_TRN"/>
								</TD>
								<TD>
									<xsl:value-of select="@LST_TBL"/>
								</TD>
								<TD>
									<xsl:value-of select="@DUR_TRN"/>
								</TD>
								<TD>
									<xsl:value-of select="substring(@DE_TRN,1,12)"/>
								</TD>
							</TR>
						</xsl:for-each>
					</TABLE>
				</xsl:when>


				<xsl:when test="REPORT/RPT_HDR/@REPORT_TYPE=5">
					<C>Account Balance Report</C>
					<L></L>
					<TABLE COLS="1,11,30,38">
						<TR>
							<TD>Account</TD>
							<TD>Name</TD>
							<TD ALIGN="RIGHT">Balance</TD>
						</TR>
						<TR>
							<TD>---------</TD>
							<TD>------------------</TD>
							<TD>--------</TD>
						</TR>
						<xsl:for-each select="REPORT/RPT_DAT">
							<TR>
								<TD>
									<xsl:value-of select="@ID_ACNT_GL"/>
								</TD>
								<TD>
									<xsl:value-of select="@NM_ACNT_GL"/>
								</TD>
								<TD ALIGN="RIGHT">
									<xsl:value-of select="@MO_BAL"/>
								</TD>
							</TR>
						</xsl:for-each>
					</TABLE>
				</xsl:when>


				<xsl:when test="REPORT/RPT_HDR/@REPORT_TYPE=6">
					<C>Reservation Status Report</C>
					<L></L>
					<TABLE COLS="1,13,18,29,38">
						<TR>
							<TD>Reservation</TD>
							<TD>Room</TD>
							<TD>Status</TD>
							<TD>Name</TD>
						</TR>
						<TR>
							<TD>-----------</TD>
							<TD>----</TD>
							<TD>----------</TD>
							<TD>----------</TD>
						</TR>
						<xsl:for-each select="REPORT/RPT_DAT">
							<TR>
								<TD>
									<xsl:value-of select="@ID_RESERVE"/>
								</TD>
								<TD>
									<xsl:value-of select="@LST_TBL"/>
								</TD>
								<TD>
									<xsl:value-of select="@CD_RESERVE"/>
								</TD>
								<TD>
									<xsl:value-of select="@DE_TRN"/>
								</TD>
							</TR>
						</xsl:for-each>
					</TABLE>
				</xsl:when>


				<xsl:when test="REPORT/RPT_HDR/@REPORT_TYPE=7">

					<C>Deposit Redemption Report</C>
					<C>For  <xsl:value-of select="REPORT/RPT_HDR/@TS_TRN_BGN"/></C>
					<L></L>
					<TABLE COLS="1,9,20,27,34,40">
						<TR>
							<TD>Account</TD>
							<TD>Name</TD>
							<TD>From</TD>
							<TD align="right">Value</TD>
							<TD align="right">Var</TD>
						</TR>

						<TR>
							<TD>-------</TD>
							<TD>----------</TD>
							<TD>------</TD>
							<TD>------</TD>
							<TD>------</TD>
						</TR>

						<xsl:for-each select="REPORT/RPT_DAT">
							<xsl:sort select="@ID_RC" data-type="number" order="ascending"/>
							<xsl:if test="not(@ID_RC=preceding-sibling::RPT_DAT/@ID_RC)">
								<xsl:if test="position()&gt;1">
									<L></L>
								</xsl:if>
								<L>
									<xsl:value-of select="@TY_TRN_SUB"/>
								</L>
								<xsl:call-template name="RPTDAT7">
									<xsl:with-param name="RECORDS" select="../RPT_DAT[@ID_RC=current()/@ID_RC]"/>
								</xsl:call-template>
							</xsl:if>
						</xsl:for-each>

						<L></L>

						<xsl:variable name="T" select="sum(REPORT/RPT_DAT/@MO_DEPOSIT)"/>
						<TR>
							<TD>TOTAL</TD>
							<TD></TD>
							<TD></TD>
							<TD>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="sum(REPORT/RPT_DAT/@MO_DEPOSIT)"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>



							<TD>
								<xsl:call-template name="format-currency">
									<xsl:with-param name="value">
										<xsl:value-of select="sum(REPORT/RPT_DAT/@MO_DEPOSIT)-sum(REPORT/RPT_DAT/@MO_REDEEM)"/>
									</xsl:with-param>
								</xsl:call-template>
							</TD>
						</TR>
					</TABLE>
				</xsl:when>
			</xsl:choose>
			<L></L>
		</xsl:if>

		<xsl:if test="@DE_ALRT">
			<L></L>
			<xsl:call-template name="multiline">
				<xsl:with-param name="line" select="concat(@DE_ALRT,'&#xD;')"/>
			</xsl:call-template>
		</xsl:if>

		<xsl:call-template name="FOOTER"></xsl:call-template>
		<L>
			<B>
				<COPY/>
			</B>
		</L>
		<xsl:call-template name="CUT"/>

		<xsl:apply-templates select="//POSTRANSACTION/LOYALTY"/>
		<xsl:if test="@FL_BILL=0">
			<xsl:apply-templates select="//POSTRANSACTION/PDRDETAIL"/>
		</xsl:if>
	</xsl:template>



	<xsl:template match="@TY_TRN">
	</xsl:template>
</xsl:stylesheet>
<!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="0002_0004_0001_0009_0000_001000293.XML" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="no" name="Scenario2" userelativepaths="yes" externalpreview="no" url="..\TRN\0003_0002_0006_000000226.XML" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><Mapper
</metaInformation>
-->